stats: configurable page size

Type: improvement
Change-Id: I9973bce20a0a2a8a7e227cf96518de5b79374425
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vppinfra/mem.h b/src/vppinfra/mem.h
index 9d0aa09..3ba20ad 100644
--- a/src/vppinfra/mem.h
+++ b/src/vppinfra/mem.h
@@ -113,6 +113,9 @@
 
   /* memory maps */
   clib_mem_vm_map_hdr_t *first_map, *last_map;
+
+  /* last error */
+  clib_error_t *error;
 } clib_mem_main_t;
 
 extern clib_mem_main_t clib_mem_main;
@@ -461,8 +464,7 @@
   return clib_mem_main.log2_default_hugepage_sz;
 }
 
-clib_error_t *clib_mem_create_fd (char *name, int *fdp);
-clib_error_t *clib_mem_create_hugetlb_fd (char *name, int *fdp);
+int clib_mem_vm_create_fd (clib_mem_page_sz_t log2_page_size, char *fmt, ...);
 clib_error_t *clib_mem_vm_ext_alloc (clib_mem_vm_alloc_t * a);
 void clib_mem_vm_ext_free (clib_mem_vm_alloc_t * a);
 uword clib_mem_get_fd_page_size (int fd);
@@ -545,6 +547,12 @@
   return 1 << clib_mem_log2_page_size_validate (log2_page_size);
 }
 
+static_always_inline clib_error_t *
+clib_mem_get_last_error (void)
+{
+  return clib_mem_main.error;
+}
+
 
 #include <vppinfra/error.h>	/* clib_panic */