27 #if defined(UNIT_TESTS) // UT_DIFF
29 #define MEMORY_TEST 0 // test mmapped-DB version in unittests (recommended setting; same as in RELEASE)
50 #define UNUSED_IN_MEMTEST(param) param = param
72 #define GB_RESOLVE(typ, struct_add, member_name) ((typ)((struct_add)->member_name))
73 #define GB_SETREL(struct_add, member_name, address) (struct_add)->member_name = (address)
77 #define GB_RESOLVE(typ, struct_add, member_name) \
78 ((typ)(((struct_add)->member_name) \
79 ? (typ) (((char*)(struct_add))+((struct_add)->member_name)) \
82 #define GB_SETREL(struct_add, member_name, address) \
84 char *pntr = (char *)(address); \
86 (struct_add)->member_name = (char*)(pntr)-(char*)(struct_add); \
89 (struct_add)->member_name = 0; \
111 #if defined(DEVEL_RALF)
112 #define FILL_MEM_ON_FREE 0xdb
118 inline void *
gbm_get_mem(
size_t size,
long ) {
return ARB_calloc<char>(size); }
119 #if defined(FILL_MEM_ON_FREE)
120 inline void gbm_free_mem(
void *
block,
size_t size,
long ) { memset(block, FILL_MEM_ON_FREE, size); free(block); }
121 #else // !defined(FILL_MEM_ON_FREE)
125 #else // MEMORY_TEST==0
132 #if defined(FILL_MEM_ON_FREE)
133 memset(block, FILL_MEM_ON_FREE, size);
138 #endif // MEMORY_TEST
141 #error gb_memory.h included twice
142 #endif // GB_MEMORY_H
void * gbm_get_mem(size_t size, long index)
void gbmFreeMemImpl(void *data, size_t size, long index)
void * gbmGetMemImpl(size_t size, long index)
void gbm_free_mem(void *block, size_t size, long index)