16 #define GSI_PRE_ALLOC(x)
17 #define GSI_POST_ALLOC()
20 #define GSI_PRE_ALLOC(x) gsMemMgrTagPush (x);
21 #define GSI_POST_ALLOC() gsMemMgrTagPop ();
24 #define GSI_PRE_ALLOC(x) gsMemMgrContextPush (x);
25 #define GSI_POST_ALLOC() gsMemMgrContextPop ();
28#if defined (__cplusplus)
37 MEMTAG_SERVER_BROWSER,
49void* gsimalloc (
size_t size);
50void* gsirealloc (
void* ptr,
size_t size);
51void gsifree (
void* ptr);
52void* gsimemalign (
size_t boundary,
size_t size);
58typedef void *(__cdecl *gsMallocCB) (
size_t size);
59typedef void (__cdecl *gsFreeCB) (
void* ptr);
60typedef void *(__cdecl *gsReallocCB) (
void* ptr,
size_t size);
61typedef void *(__cdecl *gsMemalignCB)(
size_t boundary,
size_t size);
63typedef void *(*gsMallocCB) (
size_t size);
64typedef void (*gsFreeCB) (
void* ptr);
65typedef void *(*gsReallocCB) (
void* ptr,
size_t size);
66typedef void *(*gsMemalignCB)(
size_t boundary,
size_t size);
69void gsiMemoryCallbacksSet(gsMallocCB p_malloc, gsFreeCB p_free, gsReallocCB p_realloc, gsMemalignCB p_memalign);
82 gsMemMgrContext_Invalid= -1,
83 gsMemMgrContext_Default= 0,
84 gsMemMgrContext_Count = 16
107gsMemMgrContext gsMemMgrCreate (gsMemMgrContext context,
const char *PoolName,
void* thePoolBuffer,
size_t thePoolSize);
124void gsMemMgrContextPush (gsMemMgrContext context);
125gsMemMgrContext gsMemMgrContextPop ();
129void gsMemMgrDestroy(gsMemMgrContext context);
133void gsMemMgrDumpStats();
134void gsMemMgrDumpAllocations();
135void gsMemMgrValidateMemoryPool();
140gsMemMgrContext gsMemMgrContextFind (
void *ptr);
141const char *MemMgrBufferGetName(gsMemMgrContext context);
148void gsMemMgrTagPush (gsi_u8 tag);
149void gsMemMgrTagPop ();
150gsi_u8 gsMemMgrTagGet (
void *ptr);
151gsi_u32 gsMemMgrMemUsedByTagGet(gsi_u8 tag);
154gsi_u32 gsMemMgrMemAvailGet (gsMemMgrContext context);
156gsi_u32 gsMemMgrMemUsedGet (gsMemMgrContext context);
160gsi_u32 gsMemMgrMemLargestAvailGet (gsMemMgrContext context);
166gsi_u32 gsMemMgrMemHighwaterMarkGet (gsMemMgrContext context);
170void gsMemMgrSelfText();
172#if defined (__cplusplus)