Changeset View
Changeset View
Standalone View
Standalone View
intern/guardedalloc/MEM_guardedalloc.h
| Show First 20 Lines • Show All 211 Lines • ▼ Show 20 Lines | |||||
| /* overhead for lockfree allocator (use to avoid slop-space) */ | /* overhead for lockfree allocator (use to avoid slop-space) */ | ||||
| #define MEM_SIZE_OVERHEAD sizeof(size_t) | #define MEM_SIZE_OVERHEAD sizeof(size_t) | ||||
| #define MEM_SIZE_OPTIMAL(size) ((size)-MEM_SIZE_OVERHEAD) | #define MEM_SIZE_OPTIMAL(size) ((size)-MEM_SIZE_OVERHEAD) | ||||
| #ifndef NDEBUG | #ifndef NDEBUG | ||||
| extern const char *(*MEM_name_ptr)(void *vmemh); | extern const char *(*MEM_name_ptr)(void *vmemh); | ||||
| #endif | #endif | ||||
| /** Let developers decide if the allocation name is the source location or function name. */ | |||||
HooglyBoogly: `deside` -> `decide` | |||||
| #define MEM_S1(x) #x | |||||
| #define MEM_S2(x) MEM_S1(x) | |||||
Not Done Inline Actionsundef the utility macros if possible. JacquesLucke: `undef` the utility macros if possible. | |||||
Done Inline ActionsDon't think that's possible: https://onlinegdb.com/uao7kdOXs Blendify: Don't think that's possible: https://onlinegdb.com/uao7kdOXs | |||||
| #if 1 | |||||
| # define MEM_AT __func__ | |||||
Done Inline ActionsLOCATION -> MEM_AT? JacquesLucke: `LOCATION -> MEM_AT`? | |||||
| #else | |||||
| # define MEM_AT __FILE__ ":" MEM_S2(__LINE__) | |||||
| #endif | |||||
| /** | /** | ||||
| * This should be called as early as possible in the program. When it has been called, information | * This should be called as early as possible in the program. When it has been called, information | ||||
| * about memory leaks will be printed on exit. | * about memory leaks will be printed on exit. | ||||
| */ | */ | ||||
| void MEM_init_memleak_detection(void); | void MEM_init_memleak_detection(void); | ||||
| /** | /** | ||||
| * Use this if we want to call #exit during argument parsing for example, | * Use this if we want to call #exit during argument parsing for example, | ||||
| ▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines | |||||
deside -> decide