X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Facesskernel_src%2Finclude%2Fheap.h;h=8bf7d8ec4526220be75ecd6a6a449ae89ae727a5;hb=b0da731b2d89b9dd58de2c98eaf6218a41a21920;hp=2052559721256defb62359afbe037ebc5b8afe54;hpb=45672f51180f1f0af73c2ba75723eca8f8bb8e89;p=tpg%2Facess2.git diff --git a/AcessNative/acesskernel_src/include/heap.h b/AcessNative/acesskernel_src/include/heap.h index 20525597..8bf7d8ec 100644 --- a/AcessNative/acesskernel_src/include/heap.h +++ b/AcessNative/acesskernel_src/include/heap.h @@ -4,5 +4,21 @@ #define _HEAP_H_ // NOP (stdlib.h defines the heap functions) +// Heap_Allocate is used in _strdup +extern void *Heap_Allocate(const char *File, int Line, int ByteCount); +extern void *Heap_AllocateZero(const char *File, int Line, size_t Bytes); +extern void *Heap_Reallocate(const char *File, int Line, void *Ptr, size_t Bytes); +extern void Heap_Deallocate(void *Ptr); +extern int Heap_IsHeapAddr(void *Ptr); +extern void Heap_Validate(void); +extern char *Heap_StringDup(const char *File, int Line, const char *Str); + +#define malloc(size) Heap_Allocate(_MODULE_NAME_"/"__FILE__, __LINE__, (size)) +#define calloc(num,size) Heap_AllocateZero(_MODULE_NAME_"/"__FILE__, __LINE__, (num)*(size)) +#define realloc(ptr,size) Heap_Reallocate(_MODULE_NAME_"/"__FILE__, __LINE__, (ptr), (size)) +#define free(ptr) Heap_Deallocate((ptr)) +#define IsHeap(ptr) Heap_IsHeapAddr((ptr)) + +#define strdup(Str) Heap_StringDup(_MODULE_NAME_"/"__FILE__, __LINE__, (Str)) #endif