My Project
Loading...
Searching...
No Matches
omAllocDecl.h
Go to the documentation of this file.
1/*******************************************************************
2 * File: omAllocDecl.h
3 * Purpose: declaration of Alloc routines
4 * Author: obachman (Olaf Bachmann)
5 * Created: 11/99
6 *******************************************************************/
7#ifndef OM_ALLOC_DECL_H
8#define OM_ALLOC_DECL_H
9
10#if (!defined(OM_NDEBUG) && (defined(OM_CHECK) || (defined(OM_HAVE_TRACK) && defined(OM_TRACK)))) || defined(OM_T1)
11
12/*******************************************************************
13 *
14 * Alloc/Free/Check for Debug
15 *
16 *******************************************************************/
17#ifndef OM_CHECK
18#define OM_CHECK 0
19#endif
20#ifndef OM_TRACK
21#define OM_TRACK 0
22#endif
23
24#if OM_KEEP > 0
25#define _OM_FKEEP OM_FKEEP
26#else
27#define _OM_FKEEP 0
28#endif
29
30#if !defined(OM_T_ALLOC)
31#define omTypeAllocBin(type,addr,bin) addr=(type)_omDebugAlloc(bin,OM_FBIN|_OM_FKEEP,OM_CTFL)
32#define omTypeAlloc0Bin(type,addr,bin) addr=(type)_omDebugAlloc(bin,OM_FBIN|OM_FZERO|_OM_FKEEP,OM_CTFL)
33#define omAllocBin(bin) _omDebugAlloc(bin,OM_FBIN|_OM_FKEEP,OM_CTFL)
34#define omAlloc0Bin(bin) _omDebugAlloc(bin,OM_FBIN|OM_FZERO|_OM_FKEEP,OM_CTFL)
35
36#define omTypeAlloc(type,addr,size) addr=(type)_omDebugAlloc((void*)(long)(size),OM_FSIZE|_OM_FKEEP,OM_CTFL)
37#define omTypeAlloc0(type,addr,size) addr=(type)_omDebugAlloc((void*)(long)(size),OM_FSIZE|OM_FZERO|_OM_FKEEP,OM_CTFL)
38#define omAlloc(size) _omDebugAlloc((void*)(long)(size),OM_FSIZE|_OM_FKEEP,OM_CTFL)
39#define omAlloc0(size) _omDebugAlloc((void*)(long)(size),OM_FSIZE|OM_FZERO|_OM_FKEEP,OM_CTFL)
40
41#define omalloc(size) _omDebugAlloc((void*)(size),OM_FSIZE|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL)
42#define omalloc0(size) _omDebugAlloc((void*)(size),OM_FSIZE|OM_FZERO|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL)
43
44#else
45#define omTypeAllocBin(type,addr,bin) __omTypeAllocBin(type,addr,bin)
46#define omTypeAlloc0Bin(type,addr,bin) __omTypeAlloc0Bin(type,addr,bin)
47#define omAllocBin(bin) _omAllocBin(bin)
48#define omAlloc0Bin(bin) _omAlloc0Bin(bin)
49
50#define omTypeAlloc(type,addr,size) __omTypeAlloc(type,addr,size)
51#define omTypeAlloc0(type,addr,size) __omTypeAlloc0(type,addr,size)
52#define omAlloc(size) _omAlloc(size)
53#define omAlloc0(size) _omAlloc0(size)
54
55#define omalloc(size) _omalloc(size)
56#define omalloc0(size) _omalloc0(size)
57
58#endif
59
60#if !defined(OM_T_REALLOC)
61#define omTypeReallocBin(o_addr,o_bin,type,addr,bin) addr=(type)_omDebugRealloc(o_addr,o_bin,bin,OM_FBIN|_OM_FKEEP,OM_FBIN|_OM_FKEEP,OM_CTFL)
62#define omTypeRealloc0Bin(o_addr,o_bin,type,addr,bin) addr=(type)_omDebugRealloc(o_addr,o_bin,bin,OM_FBIN|_OM_FKEEP,OM_FBIN|OM_FZERO|_OM_FKEEP,OM_CTFL)
63#define omReallocBin(o_addr,o_bin,bin) _omDebugRealloc(o_addr,o_bin,bin,OM_FBIN|_OM_FKEEP,OM_FBIN|_OM_FKEEP,OM_CTFL)
64#define omRealloc0Bin(o_addr,o_bin,bin) _omDebugRealloc(o_addr,o_bin,bin,OM_FBIN|_OM_FKEEP,OM_FBIN|OM_FZERO|_OM_FKEEP,OM_CTFL)
65
66#define omTypeReallocSize(o_addr,o_size,type,addr,size) addr=(type)_omDebugRealloc(o_addr,(void*)(o_size),(void*)(size),OM_FSIZE|_OM_FKEEP,OM_FSIZE|_OM_FKEEP,OM_CTFL)
67#define omTypeRealloc0Size(o_addr,o_size,type,addr,size) addr=(type)_omDebugRealloc(o_addr,(void*)(o_size),(void*)(size),OM_FSIZE|_OM_FKEEP,OM_FSIZE|OM_FZERO|_OM_FKEEP,OM_CTFL)
68#define omReallocSize(addr,o_size,size) _omDebugRealloc(addr,(void*)(o_size),(void*)(size),OM_FSIZE|_OM_FKEEP,OM_FSIZE|_OM_FKEEP,OM_CTFL)
69#define omRealloc0Size(addr,o_size,size) _omDebugRealloc(addr,(void*)(o_size),(void*)(size),OM_FSIZE|_OM_FKEEP,OM_FSIZE|OM_FZERO|_OM_FKEEP,OM_CTFL)
70
71#define omTypeRealloc(o_addr,type,addr,size) addr=(type)_omDebugRealloc(o_addr,NULL,(void*)(size),_OM_FKEEP,OM_FSIZE|_OM_FKEEP,OM_CTFL)
72#define omTypeRealloc0(o_addr,type,addr,size) addr=(type)_omDebugRealloc(o_addr,NULL,(void*)(size),_OM_FKEEP,OM_FSIZE|OM_FZERO|_OM_FKEEP,OM_CTFL)
73#define omRealloc(addr,size) _omDebugRealloc(addr,NULL,(void*)(size),_OM_FKEEP,OM_FSIZE,OM_CTFL)
74#define omRealloc0(addr,size) _omDebugRealloc(addr,NULL,(void*)(size),_OM_FKEEP,OM_FSIZE|OM_FZERO,OM_CTFL)
75
76#define omreallocSize(addr,o_size,size) _omDebugRealloc(addr,(void*)(o_size),(void*)(size),OM_FSIZE|OM_FSLOPPY|_OM_FKEEP,OM_FSIZE|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL)
77#define omrealloc0Size(addr,o_size,size)_omDebugRealloc(addr,(void*)(o_size),(void*)(size),OM_FSIZE|OM_FSLOPPY|_OM_FKEEP,OM_FSIZE|OM_FZERO|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL)
78#define omrealloc(addr,size) _omDebugRealloc(addr,NULL,(void*)(size),OM_FSLOPPY|_OM_FKEEP,OM_FSIZE|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL)
79#define omrealloc0(addr,size) _omDebugRealloc(addr,NULL,(void*)(size),OM_FSLOPPY|_OM_FKEEP,OM_FSIZE|OM_FZERO|OM_FSLOPPY|OM_FALIGN|_OM_FKEEP,OM_CTFL)
80
81#else
82#define omTypeReallocBin(o_addr,o_bin,type,addr,bin) __omTypeReallocBin(o_addr,o_bin,type,addr,bin)
83#define omTypeRealloc0Bin(o_addr,o_bin,type,addr,bin) __omTypeRealloc0Bin(o_addr,o_bin,type,addr,bin)
84#define omReallocBin(o_addr,o_bin,bin) _omReallocBin(o_addr,o_bin,bin)
85#define omRealloc0Bin(o_addr,o_bin,bin) _omRealloc0Bin(o_addr,o_bin,bin)
86
87#define omTypeReallocSize(o_addr,o_size,type,addr,size) __omTypeReallocSize(o_addr,o_size,type,addr,size)
88#define omTypeRealloc0Size(o_addr,o_size,type,addr,size) __omTypeRealloc0Size(o_addr,o_size,type,addr,size)
89#define omReallocSize(addr,o_size,size) _omReallocSize(addr,o_size,size)
90#define omRealloc0Size(addr,o_size,size) _omRealloc0Size(addr,o_size,size)
91
92#define omTypeRealloc(o_addr,type,addr,size) __omTypeRealloc(o_addr,type,addr,size)
93#define omTypeRealloc0(o_addr,type,addr,size) __omTypeRealloc0(o_addr,type,addr,size)
94#define omRealloc(addr,size) _omRealloc(addr,size)
95#define omRealloc0(addr,size) _omRealloc0(addr,size)
96
97#define omreallocSize(addr,o_size,size) _omreallocSize(addr,o_size,size)
98#define omrealloc0Size(addr,o_size,size)_omrealloc0Size(addr,o_size,size)
99#define omrealloc(addr,size) _omrealloc(addr, size)
100#define omrealloc0(addr,size) _omrealloc0(addr, size)
101
102#endif
103
104#if !defined(OM_T_FREE1)
105#define omFreeBinAddr(addr) _omDebugFree(addr,NULL,OM_FBINADDR|_OM_FKEEP,OM_CFL)
106#define omFreeBin(addr,bin) _omDebugFree(addr,bin,OM_FBIN|_OM_FKEEP,OM_CFL)
107#else
108#define omFreeBinAddr(addr) __omFreeBinAddr(addr)
109#define omFreeBin(addr,bin) __omFreeBinAddr(addr)
110#endif
111
112#if !defined(OM_T_FREE2)
113#define omFreeSize(addr,size) _omDebugFree(addr,(void*)(long)(size),OM_FSIZE|_OM_FKEEP,OM_CFL)
114#define omfreeSize(addr,size) _omDebugFree(addr,(void*)(long)(size),OM_FSIZE|OM_FSLOPPY|_OM_FKEEP,OM_CFL)
115#else
116#define omFreeSize(addr,size) __omFreeSize(addr,size)
117#define omfreeSize(addr,size) do {if (addr && size) omFreeSize(addr, size);} while (0)
118#endif
119
120#if !defined(OM_T_FREE3)
121#define omFree(addr) _omDebugFree(addr,0,0,OM_CFL)
122#define omfree(addr) _omDebugFree(addr,NULL,OM_FSLOPPY|_OM_FKEEP,OM_CFL)
123#else
124#define omFree(addr) __omFree(addr)
125#define omfree(addr) do {if (addr) omFree(addr);} while (0)
126#endif
127
128#if !defined(OM_T_STR)
129#define omStrDup(s) _omDebugStrDup(s,OM_TFL)
130#define omMemDup(addr) _omDebugMemDup(addr,_OM_FKEEP,OM_CTFL)
131#else
132#define omStrDup(s) _omStrDup(s)
133#define omMemDup(s) _omMemDup(s)
134#endif
135
136#define omDebugBinAddr(addr) _omDebugAddr(addr,NULL,OM_FBINADDR,OM_CFL)
137#define omDebugAddrBin(addr, bin) _omDebugAddr(addr,bin,OM_FBIN,OM_CFL)
138#define omDebugBinAddrSize(addr, size) _omDebugAddr(addr,(void*)(size),OM_FBINADDR|OM_FSIZE,OM_CFL)
139#define omDebugAddrSize(addr,size) _omDebugAddr(addr,(void*)(size),OM_FSIZE,OM_CFL)
140#define omDebugAddr(addr) _omDebugAddr(addr,NULL, 0, OM_CFL)
141#define omdebugAddrSize(addr,size) _omDebugAddr(addr,(void*)(size),OM_FSIZE|OM_FSLOPPY,OM_CFL)
142#define omdebugAddr(addr) _omDebugAddr(addr,NULL, OM_FSLOPPY, OM_CFL)
143#define omDebugBin(bin) _omDebugBin(bin,OM_CFL)
144#define omDebugMemory() _omDebugMemory(OM_CFL)
145#define omDebugIf(cond, statement) do { if (cond) {statement;}} while (0)
146
147#if OM_CHECK > 0
148#define omCheckBinAddr omDebugBinAddr
149#define omCheckAddrBin omDebugAddrBin
150#define omCheckBinAddrSize omDebugBinAddrSize
151#define omCheckAddrSize omDebugAddrSize
152#define omCheckAddr omDebugAddr
153#define omcheckAddrSize omdebugAddrSize
154#define omcheckAddr omdebugAddr
155#define omCheckBin omDebugBin
156#define omCheckMemory omDebugMemory
157#define omCheckIf omDebugIf
158#endif /* OM_CHECK > 0 */
159
160
161#ifdef OM_ALIGNMENT_NEEDS_WORK
162
163#define omTypeAllocAligned(type,addr,size) addr=(type)_omDebugAlloc((void*)(size),OM_FSIZE|OM_FALIGN|_OM_FKEEP,OM_CTFL)
164#define omTypeAlloc0Aligned(type,addr,size) addr=(type)_omDebugAlloc((void*)(size),OM_FSIZE|OM_FZERO|OM_FALIGN|_OM_FKEEP,OM_CTFL)
165#define omAllocAligned(size) _omDebugAlloc((void*)(size),OM_FSIZE|OM_FALIGN|_OM_FKEEP,OM_CTFL)
166#define omAlloc0Aligned(size) _omDebugAlloc((void*)(size),OM_FSIZE|OM_FZERO|OM_FALIGN|_OM_FKEEP,OM_CTFL)
167
168#define omTypeReallocAlignedSize(o_addr,o_size,type,addr,size) addr=(type)_omDebugRealloc(o_addr,(void*)(o_size),(void*)(size),OM_FSIZE|_OM_FKEEP,OM_FSIZE|OM_FALIGN|_OM_FKEEP,OM_CTFL)
169#define omTypeRealloc0AlignedSize(o_addr,o_size,type,addr,size) addr=(type)_omDebugRealloc(o_addr,(void*)(o_size),(void*)(size),OM_FSIZE|_OM_FKEEP,OM_FSIZE|OM_FZERO|OM_FALIGN|_OM_FKEEP,OM_CTFL)
170#define omReallocAlignedSize(addr,o_size,size) _omDebugRealloc(addr,(void*)(o_size),(void*)(size),OM_FSIZE|_OM_FKEEP,OM_FSIZE|OM_FALIGN|_OM_FKEEP,OM_CTFL)
171#define omRealloc0AlignedSize(addr,o_size,size) _omDebugRealloc(addr,(void*)(o_size),(void*)(size),OM_FSIZE|_OM_FKEEP,OM_FSIZE|OM_FZERO|OM_FALIGN|_OM_FKEEP,OM_CTFL)
172
173#define omTypeReallocAligned(o_addr,type,addr,size) addr=(type)_omDebugRealloc(o_addr,NULL,(void*)(size),_OM_FKEEP,OM_FSIZE|OM_FALIGN|_OM_FKEEP,OM_CTFL)
174#define omTypeRealloc0Aligned(o_addr,type,addr,size) addr=(type)_omDebugRealloc(o_addr,NULL,(void*)(size),_OM_FKEEP,OM_FSIZE|OM_FZERO|OM_FALIGN|_OM_FKEEP,OM_CTFL)
175#define omReallocAligned(addr,size) _omDebugRealloc(addr,NULL,(void*)(size),0,OM_FSIZE|OM_FALIGN|_OM_FKEEP,OM_CTFL)
176#define omRealloc0Aligned(addr,size) _omDebugRealloc(addr,NULL,(void*)(size),0,OM_FSIZE|OM_FZERO|OM_FALIGN|_OM_FKEEP,OM_CTFL)
177
178#define omMemDupAligned(addr) _omDebugMemDup(addr,OM_FALIGN|_OM_FKEEP,OM_CTFL)
179
180#define omDebugBinAddrAligned(addr) _omDebugAddr(addr,NULL,OM_FBINADDR|OM_FALIGN,OM_CFL)
181#define omDebugAddrAlignedBin(addr, bin) _omDebugAddr(addr,bin,OM_FBIN|OM_FALIGN,OM_CFL)
182#define omDebugAddrAlignedSize(addr,size) _omDebugAddr(addr,(void*)(size),OM_FSIZE|OM_FALIGN,OM_CFL)
183#define omDebugAddrAligned(addr) _omDebugAddr(addr,NULL, OM_FALIGN, OM_CFL)
184#define omdebugAddrAlignedSize(addr,size) _omDebugAddr(addr,(void*)(size),OM_FSIZE|OM_FSLOPPY|OM_FALIGN,OM_CFL)
185#define omdebugAddrAligned(addr) _omDebugAddr(addr,NULL, OM_FSLOPPY|OM_FALIGN, OM_CFL)
186
187#if OM_CHECK > 0
188#define omCheckBinAddrAligned omDebugBinAddrAligned
189#define omCheckAddrAlignedBin omDebugAddrAlignedBin
190#define omCheckAddrAlignedSize omDebugAddrAlignedSize
191#define omCheckAddrAligned omDebugAddrAligned
192#define omcheckAddrAlignedSize omdebugAddrAlignedSize
193#define omcheckAddrAligned omdebugAddrAligned
194#endif
195#endif /* OM_ALIGNMENT_NEEDS_WORK */
196
197#else
198/*******************************************************************
199 *
200 * Alloc/Free -- the real thing
201 *
202 *******************************************************************/
203#define omTypeAllocBin(type,addr,bin) __omTypeAllocBin(type,addr,bin)
204#define omTypeAlloc0Bin(type,addr,bin) __omTypeAlloc0Bin(type,addr,bin)
205#define omAllocBin(bin) _omAllocBin(bin)
206#define omAlloc0Bin(bin) _omAlloc0Bin(bin)
207
208#define omTypeAlloc(type,addr,size) __omTypeAlloc(type,addr,size)
209#define omTypeAlloc0(type,addr,size) __omTypeAlloc0(type,addr,size)
210#define omAlloc(size) _omAlloc(size)
211#define omAlloc0(size) _omAlloc0(size)
212
213#define omTypeReallocBin(o_addr,o_bin,type,addr,bin) __omTypeReallocBin(o_addr,o_bin,type,addr,bin)
214#define omTypeRealloc0Bin(o_addr,o_bin,type,addr,bin) __omTypeRealloc0Bin(o_addr,o_bin,type,addr,bin)
215#define omReallocBin(o_addr,o_bin,bin) _omReallocBin(o_addr,o_bin,bin)
216#define omRealloc0Bin(o_addr,o_bin,bin) _omRealloc0Bin(o_addr,o_bin,bin)
217
218#define omTypeReallocSize(o_addr,o_size,type,addr,size) __omTypeReallocSize(o_addr,o_size,type,addr,size)
219#define omTypeRealloc0Size(o_addr,o_size,type,addr,size) __omTypeRealloc0Size(o_addr,o_size,type,addr,size)
220#define omReallocSize(addr,o_size,size) _omReallocSize(addr,o_size,size)
221#define omRealloc0Size(addr,o_size,size) _omRealloc0Size(addr,o_size,size)
222
223#define omTypeRealloc(o_addr,type,addr,size) __omTypeRealloc(o_addr,type,addr,size)
224#define omTypeRealloc0(o_addr,type,addr,size) __omTypeRealloc0(o_addr,type,addr,size)
225#define omRealloc(addr,size) _omRealloc(addr,size)
226#define omRealloc0(addr,size) _omRealloc0(addr,size)
227
228#define omalloc(size) _omalloc(size)
229#define omalloc0(size) _omalloc0(size)
230
231#define omreallocSize(addr,o_size,size) _omreallocSize(addr,o_size,size)
232#define omrealloc0Size(addr,o_size,size)_omrealloc0Size(addr,o_size,size)
233#define omrealloc(addr,size) _omrealloc(addr, size)
234#define omrealloc0(addr,size) _omrealloc0(addr, size)
235
236#define omfreeSize(addr,size) do {if (addr && size) omFreeSize(addr, size);} while (0)
237#define omfree(addr) do {if (addr) omFree(addr);} while (0)
238
239#ifdef OM_ALIGNMENT_NEEDS_WORK
240#define omTypeAllocAligned(type,addr,size) __omTypeAllocAligned(type,addr,size)
241#define omTypeAlloc0Aligned(type,addr,size) __omTypeAlloc0Aligned(type,addr,size)
242#define omAllocAligned(size) _omAllocAligned(size)
243#define omAlloc0Aligned(size) _omAlloc0Aligned(size)
244
245#define omTypeReallocAlignedSize(o_addr,o_size,type,addr,size) __omTypeReallocAlignedSize(o_addr,o_size,type,addr,size)
246#define omTypeRealloc0AlignedSize(o_addr,o_size,type,addr,size) __omTypeRealloc0AlignedSize(o_addr,o_size,type,addr,size)
247#define omReallocAlignedSize(addr,o_size,size) _omReallocAlignedSize(addr,o_size,size)
248#define omRealloc0AlignedSize(addr,o_size,size) _omRealloc0AlignedSize(addr,o_size,size)
249
250#define omTypeReallocAligned(o_addr,type,addr,size) __omTypeReallocAligned(o_addr,type,addr,size)
251#define omTypeRealloc0Aligned(o_addr,type,addr,size) __omTypeRealloc0Aligned(o_addr,type,addr,size)
252#define omReallocAligned(addr,size) _omReallocAligned(addr,size)
253#define omRealloc0Aligned(addr,size) _omRealloc0Aligned(addr,size)
254
255#define omMemDupAligned(addr) _omMemDupAligned(addr)
256#endif /* OM_ALIGNMENT_NEEDS_WORK */
257
258#define omFreeBinAddr(addr) __omFreeBinAddr(addr)
259#define omFreeBin(addr,bin) __omFreeBinAddr(addr)
260#define omFreeSize(addr,size) __omFreeSize(addr,size)
261#define omFree(addr) __omFree(addr)
262
263#define omStrDup(s) _omStrDup(s)
264#define omMemDup(s) _omMemDup(s)
265
266#endif /* ! debug && ! the real thing */
267
268
269/* define alignment stuff, if necessary */
270#if !defined(omTypeAllocAligned)
271#define omTypeAllocAligned omTypeAlloc
272#define omTypeAlloc0Aligned omTypeAlloc0
273#define omAllocAligned omAlloc
274#define omAlloc0Aligned omAlloc0
275
276#define omTypeReallocAlignedSize omTypeReallocSize
277#define omTypeRealloc0AlignedSize omTypeRealloc0Size
278#define omReallocAlignedSize omReallocSize
279#define omRealloc0AlignedSize omRealloc0Size
280
281#define omTypeReallocAligned omTypeRealloc
282#define omTypeRealloc0Aligned omTypeRealloc0
283#define omReallocAligned omRealloc
284#define omRealloc0Aligned omRealloc0
285
286#define omMemDupAligned omMemDup
287#endif /* !defined(omTypeAllocAligned) */
288
289#if !defined(omDebugAddrAlignedBin)
290#define omDebugBinAddrAligned omDebugBinAddr
291#define omDebugAddrAlignedBin omDebugAddrBin
292#define omDebugAddrAlignedSize omDebugAddrSize
293#define omDebugAddrAligned omDebugAddr
294#define omdebugAddrAlignedSize omdebugAddrSize
295#define omdebugAddrAligned omdebugAddr
296#endif /* !defined(omDebugAddrAlignedBin) */
297
298#if !defined(omCheckAddrAlignedBin)
299#define omCheckBinAddrAligned omCheckBinAddr
300#define omCheckAddrAlignedBin omCheckAddrBin
301#define omCheckAddrAlignedSize omCheckAddrSize
302#define omCheckAddrAligned omCheckAddr
303#define omcheckAddrAlignedSize omcheckAddrSize
304#define omcheckAddrAligned omcheckAddr
305#endif /* !defined(omCheckAddrAlignedBin) */
306
307/* define debug stuff, if necessary */
308#if !defined(omDebugAddrBin)
309#define omDebugIf(cond, test) do {} while (0)
310#define omDebugBinAddr(addr) do {} while (0)
311#define omDebugAddrBin(addr,bin) do {} while (0)
312#define omDebugBinAddrSize(addr,size) do {} while (0)
313#define omDebugAddrSize(addr,size) do {} while (0)
314#define omDebugAddr(addr) do {} while (0)
315#define omdebugAddrSize(addr,size) do {} while (0)
316#define omdebugAddr(addr) do {} while (0)
317#define omDebugBin(bin) do {} while (0)
318#define omDebugMemory() do {} while (0)
319#endif /* !defined(omDebugAddrBin) */
320
321/* define check stuff, if necessary */
322#if !defined(omCheckAddrBin)
323#define omCheckIf(cond, test) do {} while (0)
324#define omCheckBinAddr(addr) do {} while (0)
325#define omCheckAddrBin(addr,bin) do {} while (0)
326#define omCheckBinAddrSize(addr,size) do {} while (0)
327#define omCheckAddrSize(addr,size) do {} while (0)
328#define omCheckAddr(addr) do {} while (0)
329#define omcheckAddrSize(addr,size) do {} while (0)
330#define omcheckAddr(addr) do {} while (0)
331#define omCheckBin(bin) do {} while (0)
332#define omCheckMemory() do {} while (0)
333#endif /* !defined(omCheckAddrBin) */
334
335
336
337#if !defined(OM_NDEBUG)
338omError_t omTestAddrBin(void* addr, omBin bin, int check_level);
339omError_t omTestBinAddr(void* addr, int check_level);
340omError_t omTestBinAddrSize(void* addr, size_t size, int check_level);
341omError_t omTestAddrSize(void* addr, size_t size, int check_level);
342omError_t omTestAddr(void* addr, int check_level);
343omError_t omtestAddrSize(void* addr, size_t size, int check_level);
344omError_t omtestAddr(void* addr, int check_level);
345omError_t omTestAddrAlignedBin(void* addr, omBin bin, int check_level);
346omError_t omTestAddrAlignedSize(void* addr, size_t size, int check_level);
347omError_t omTestAddrAligned(void* addr, int check_level);
348omError_t omtestAddrAlignedSize(void* addr, size_t size, int check_level);
349omError_t omtestAddrAligned(void* addr, int check_level);
350omError_t omTestBin(omBin bin, int check_level);
351omError_t omTestMemory(int check_level);
352#define omTestIf(cond, statement) do { if (cond) {statement;}} while (0)
353
354#else
355
356#define omTestIf(cond, test) do {} while (0)
357#define omTestAddrBin(addr,bin,l) do {} while (0)
358#define omTestBinAddr(addr,l) do {} while (0)
359#define omTestBinAddrSize(addr,size,l) do {} while (0)
360#define omTestAddrSize(addr,size,l) do {} while (0)
361#define omTestAddr(addr,l) do {} while (0)
362#define omtestAddrSize(addr,size,l) do {} while (0)
363#define omtestAddr(addr,l) do {} while (0)
364#define omTestAddrAlignedBin(addr,bin,l) do {} while (0)
365#define omTestAddrAlignedSize(addr,size,l) do {} while (0)
366#define omTestAddrAligned(addr,l) do {} while (0)
367#define omtestAddrAlignedSize(addr,size,l) do {} while (0)
368#define omtestAddrAligned(addr,l) do {} while (0)
369#define omTestBin(bin,l) do {} while (0)
370#define omTestMemory(l) do {} while (0)
371
372#endif
373
374#endif /* OM_ALLOC_DECL_H */
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition: cf_ops.cc:600
omError_t omTestBinAddr(void *addr, int check_level)
Definition: omDebug.c:52
omError_t omTestBin(omBin bin, int check_level)
Definition: omDebug.c:90
omError_t omTestAddrSize(void *addr, size_t size, int check_level)
Definition: omDebug.c:48
omError_t omtestAddr(void *addr, int check_level)
Definition: omDebug.c:64
omError_t omtestAddrSize(void *addr, size_t size, int check_level)
Definition: omDebug.c:60
omError_t omTestMemory(int check_level)
Definition: omDebug.c:94
omError_t omtestAddrAlignedSize(void *addr, size_t size, int check_level)
Definition: omDebug.c:81
omError_t omTestAddr(void *addr, int check_level)
Definition: omDebug.c:56
omError_t omTestAddrAligned(void *addr, int check_level)
Definition: omDebug.c:77
omError_t omtestAddrAligned(void *addr, int check_level)
Definition: omDebug.c:85
omError_t omTestAddrBin(void *addr, omBin bin, int check_level)
Definition: omDebug.c:40
omError_t omTestAddrAlignedBin(void *addr, omBin bin, int check_level)
Definition: omDebug.c:69
omError_t omTestAddrAlignedSize(void *addr, size_t size, int check_level)
Definition: omDebug.c:73
enum omError_e omError_t
Definition: omError.h:44
omBin_t * omBin
Definition: omStructs.h:12
#define omTestBinAddrSize(A, B, C)
Definition: xalloc.h:272