InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MemoryUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: pmessmer
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //
23 // Memory utilities
24 //
25 //========================================================================================
26 
27 #ifndef __MEMORYUTILS__
28 #define __MEMORYUTILS__
29 
30 #if defined (MACINTOSH) || defined (WASM)
31 #define MEM_FUNC_DECL __attribute__ ((visibility("default")))
32 #else
33  #ifdef PMRUNTIME_BUILD
34  #define MEM_FUNC_DECL __declspec(dllexport)
35  #else
36  #define MEM_FUNC_DECL __declspec(dllimport)
37 #endif
38 
39 #endif
40 
41 namespace K2Memory
42 {
43 
51 MEM_FUNC_DECL void *RTLCompatibleNewDelegate (size_t size);
52 
60 MEM_FUNC_DECL void *RTLCompatibleNewArrayDelegate (size_t size);
61 
67 MEM_FUNC_DECL void RTLCompatibleDeleteDelegate (void *p);
68 
74 MEM_FUNC_DECL void RTLCompatibleDeleteArrayDelegate (void *p);
75 
83 MEM_FUNC_DECL void StopTrackingRTLCompatibleAllocation (void *p);
84 
91 MEM_FUNC_DECL void *RTLCompatibleMalloc (size_t size);
92 
93 
99 MEM_FUNC_DECL void *RTLCompatibleMallocNoPurging (size_t size);
100 
106 MEM_FUNC_DECL void RTLCompatibleFree (void *p);
107 
115 MEM_FUNC_DECL void *RTLCompatibleRealloc (void *p, size_t size);
116 
124 MEM_FUNC_DECL size_t RTLCompatibleMallocSize (void *p);
125 
126 
127 #if defined(MACINTOSH) && defined(DEBUG)
128 
129 // Used to completely bypass any overrides on malloc/free that may have been done. Used by BypassAllocator
130 MEM_FUNC_DECL void *RTLCompatibleBypassMalloc (size_t size);
131 MEM_FUNC_DECL void RTLCompatibleBypassFree (void *p);
132 
133 #endif
134 };
135 
136 
137 #endif // __MEMORYUTILS__