AcessNative - Implemented events, don't trust them
[tpg/acess2.git] / AcessNative / acesskernel_src / include / heap.h
1 /**
2  */
3 #ifndef _HEAP_H_
4 #define _HEAP_H_
5
6 // NOP (stdlib.h defines the heap functions)
7 // Heap_Allocate is used in _strdup
8 extern void     *Heap_Allocate(const char *File, int Line, int ByteCount);
9 extern void     *Heap_AllocateZero(const char *File, int Line, size_t Bytes);
10 extern void     *Heap_Reallocate(const char *File, int Line, void *Ptr, size_t Bytes);
11 extern void     Heap_Deallocate(void *Ptr);
12 extern int      Heap_IsHeapAddr(void *Ptr);
13 extern void     Heap_Validate(void);
14
15 #define malloc(size)    Heap_Allocate(_MODULE_NAME_"/"__FILE__, __LINE__, (size))
16 #define calloc(num,size)        Heap_AllocateZero(_MODULE_NAME_"/"__FILE__, __LINE__, (num)*(size))
17 #define realloc(ptr,size)       Heap_Reallocate(_MODULE_NAME_"/"__FILE__, __LINE__, (ptr), (size))
18 #define free(ptr)       Heap_Deallocate((ptr))
19 #define IsHeap(ptr)     Heap_IsHeapAddr((ptr))
20
21 #define strdup(Str)     _strdup(_MODULE_NAME_"/"__FILE__, __LINE__, (Str))
22
23 #endif

UCC git Repository :: git.ucc.asn.au