8 } palacios_memcheck_memtype_t;
10 #ifdef V3_CONFIG_DEBUG_MEM_ALLOC
12 // Maxmimum number of simultaneous allocations to handle
13 #define NUM_ALLOCS 16384
16 // The following macros are used
17 // in the stub functions to call back to the memory
18 // checker - if memory allocation hecking is not enabled, these
21 #define MEMCHECK_INIT() palacios_memcheck_init()
22 #define MEMCHECK_KMALLOC(ptr,size) palacios_memcheck_alloc(ptr,size,PALACIOS_KMALLOC)
23 #define MEMCHECK_KFREE(ptr) palacios_memcheck_free(ptr,0,PALACIOS_KMALLOC)
24 #define MEMCHECK_VMALLOC(ptr,size) palacios_memcheck_alloc(ptr,size,PALACIOS_VMALLOC)
25 #define MEMCHECK_VFREE(ptr) palacios_memcheck_free(ptr,0,PALACIOS_VMALLOC)
26 #define MEMCHECK_ALLOC_PAGES(ptr,size) palacios_memcheck_alloc(ptr,size,PALACIOS_PAGE_ALLOC)
27 #define MEMCHECK_FREE_PAGES(ptr,size) palacios_memcheck_free(ptr,size,PALACIOS_PAGE_ALLOC)
28 #define MEMCHECK_DEINIT() palacios_memcheck_deinit()
30 void palacios_memcheck_init(void);
31 void palacios_memcheck_alloc(void *ptr, unsigned long size, palacios_memcheck_memtype_t type);
32 void palacios_memcheck_free(void *ptr, unsigned long size, palacios_memcheck_memtype_t type);
33 void palacios_memcheck_deinit(void);
38 // The following is what happens when lock checking is not on
40 #define MEMCHECK_INIT()
41 #define MEMCHECK_KMALLOC(ptr,size)
42 #define MEMCHECK_KFREE(ptr)
43 #define MEMCHECK_VMALLOC(ptr,size)
44 #define MEMCHECK_VFREE(ptr)
45 #define MEMCHECK_ALLOC_PAGES(ptr,size)
46 #define MEMCHECK_FREE_PAGES(ptr,size)
47 #define MEMCHECK_DEINIT()