source: git/omalloc/omAllocDecl.h @ a28549

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