1 krisbash 1.1 #ifndef _pal_ownedmemory_h
2 #define _pal_ownedmemory_h
3
4 #include <pal/palcommon.h>
5
6 PAL_BEGIN_EXTERNC
7
8 /*
9 * Usage of these APIs is specifically in those places where the allocation happens on ad-hoc calls
10 * And there is no single place where someone can deallocate all memory allocated so far possibly because
11 * the memory allocation was done as part of shared library and there is no single exit point since atexit
12 * does not run upon its unload on unix systems
13 * the memory locations which were allocated will be kept till the end of program or till you call OwnedMemory_Free
14 * the memory will be in address space of PAL shared library on unix systems and non non-unix ones it will be part of anyone
15 * who links against PAL static library
16 */
17 void *OwnedMemory_Alloc(size_t length);
18
19 int OwnedMemory_Free(void *ptr);
20
21 PAL_END_EXTERNC
22 krisbash 1.1
23 #endif /* _pal_ownedmemory_h */
|