My Project
Loading...
Searching...
No Matches
omDebug.c
Go to the documentation of this file.
1/*******************************************************************
2 * File: omTest.c
3 * Purpose: implementation of main omTest functions
4 * Author: obachman@mathematik.uni-kl.de (Olaf Bachmann)
5 * Created: 7/00
6 *******************************************************************/
7#include <limits.h>
8#include <string.h>
9#include "omConfig.h"
10#include "omalloc.h"
11#include "omDebug.h"
12#include "omReturn.h"
13
14#ifndef OM_NDEBUG
15/*******************************************************************
16 *
17 * Declarations
18 *
19 *******************************************************************/
20
21static void* __omDebugAlloc(void* size_bin, omTrackFlags_t flags, char track, OM_FLR_DECL);
22static void* __omDebugRealloc(void* old_addr, void* old_size_bin, void* new_size_bin,
23 omError_t old_status, omTrackFlags_t old_flags,
24 omTrackFlags_t new_flags,
25 char track, OM_FLR_DECL);
26static void __omDebugFree(void* addr, void* size_bin, omTrackFlags_t flags, OM_FLR_DECL);
27
29static unsigned long om_NumberOfKeptAddrs = 0;
32
33
34/*******************************************************************
35 *
36 * Test routines
37 *
38 *******************************************************************/
39#define OM_CLFL check_level OM_FL_KOMMA OM_FL
40omError_t omTestAddrBin(void* addr, omBin bin, int check_level)
41{
42 return _omDebugAddr(addr,bin,OM_FBIN,OM_CLFL);
43}
44omError_t omTestBinAddrSize(void* addr, size_t size, int check_level)
45{
46 return _omDebugAddr(addr,(void*)(size),OM_FSIZE|OM_FBINADDR,OM_CLFL);
47}
48omError_t omTestAddrSize(void* addr, size_t size, int check_level)
49{
50 return _omDebugAddr(addr,(void*)(size),OM_FSIZE,OM_CLFL);
51}
52omError_t omTestBinAddr(void* addr, int check_level)
53{
54 return _omDebugAddr(addr,NULL, OM_FBINADDR, OM_CLFL);
55}
56omError_t omTestAddr(void* addr, int check_level)
57{
58 return _omDebugAddr(addr,NULL, 0, OM_CLFL);
59}
60omError_t omtestAddrSize(void* addr, size_t size, int check_level)
61{
62 return _omDebugAddr(addr,(void*)(size),OM_FSIZE|OM_FSLOPPY,OM_CLFL);
63}
64omError_t omtestAddr(void* addr, int check_level)
65{
66 return _omDebugAddr(addr,NULL, OM_FSLOPPY, OM_CLFL);
67}
68
69omError_t omTestAddrAlignedBin(void* addr, omBin bin, int check_level)
70{
71 return _omDebugAddr(addr,bin,OM_FBIN|OM_FALIGN,OM_CLFL);
72}
73omError_t omTestAddrAlignedSize(void* addr, size_t size, int check_level)
74{
75 return _omDebugAddr(addr,(void*)(size),OM_FSIZE|OM_FALIGN,OM_CLFL);
76}
77omError_t omTestAddrAligned(void* addr, int check_level)
78{
79 return _omDebugAddr(addr,NULL, OM_FALIGN, OM_CLFL);
80}
81omError_t omtestAddrAlignedSize(void* addr, size_t size, int check_level)
82{
84}
85omError_t omtestAddrAligned(void* addr, int check_level)
86{
88}
89
90omError_t omTestBin(omBin bin, int check_level)
91{
92 return _omDebugBin(bin, OM_CLFL);
93}
94omError_t omTestMemory(int check_level)
95{
96 return _omDebugMemory(OM_CLFL);
97}
98
99#undef MAX
100#define MAX(a,b) (a > b ? a : b)
101#undef MIN
102#define MIN(a,b) (a < b ? a : b)
103
104/*******************************************************************
105 *
106 * First level _omDebug alloc/free routines: call respective checks and dispatch
107 * to routines which do the actual work
108 *
109 *******************************************************************/
110void* _omDebugAlloc(void* size_bin, omTrackFlags_t flags, OM_CTFL_DECL)
111{
112 void* addr;
113 OM_R_DEF;
114 check = MAX(check, om_Opts.MinCheck);
115 track = MAX(track, om_Opts.MinTrack);
116 check = MIN(check, om_Opts.MaxCheck);
117 track = MIN(track, om_Opts.MaxTrack);
118
119 if (check)
120 {
121 if (check > 1)
122 {
123 if (flags & OM_FBIN)
124 (void) _omCheckBin((omBin)size_bin, 1, check-1, omError_MemoryCorrupted, OM_FLR_VAL);
125 else if (check > 2)
126 {
128 (void) _omCheckMemory(check-2, omError_MemoryCorrupted, OM_FLR_VAL);
129 }
130 }
131 if (size_bin == NULL && ! (flags & OM_FSLOPPY))
132 {
134 }
135 }
136
137 addr = __omDebugAlloc(size_bin, flags, track, OM_FLR_VAL);
138
139#ifdef OM_INTERNAL_DEBUG
140 (void) _omCheckAddr(addr, size_bin,flags|OM_FUSED,check, omError_InternalBug, OM_FLR);
141#endif
142
143 return addr;
144}
145
146
147void* _omDebugRealloc(void* old_addr, void* old_size_bin, void* new_size_bin,
148 omTrackFlags_t old_flags, omTrackFlags_t new_flags, OM_CTFL_DECL)
149{
150 void* new_addr = NULL;
152 OM_R_DEF;
153 check = MAX(check, om_Opts.MinCheck);
154 track = MAX(track, om_Opts.MinTrack);
155 check = MIN(check, om_Opts.MaxCheck);
156 track = MIN(track, om_Opts.MaxTrack);
157
158 if (check)
159 {
160 status = _omCheckAddr(old_addr, old_size_bin, old_flags|OM_FUSED, check, omError_NoError, OM_FLR_VAL);
161
162 if (status == omError_NoError && check > 1 && new_flags & OM_FBIN)
163 status = omDoCheckBin((omBin)new_size_bin, 1, check-1, omError_MemoryCorrupted, OM_FLR_VAL);
164
165 if (new_size_bin == NULL && !(new_flags & OM_FSLOPPY))
166 {
168 new_size_bin = (void*) 1;
169 }
170 }
171
172 new_addr = __omDebugRealloc(old_addr, old_size_bin, new_size_bin,
173 status, old_flags, new_flags, track, OM_FLR_VAL);
174#ifdef OM_INTERNAL_DEBUG
175 if (status == omError_NoError)
176 (void) _omCheckAddr(new_addr, new_size_bin,new_flags|OM_FUSED,check, omError_InternalBug, OM_FLR);
177#endif
178
179 return new_addr;
180}
181
182void _omDebugFree(void* addr, void* size_bin,
183 omTrackFlags_t flags, OM_CFL_DECL)
184{
185 OM_R_DEF;
186 check = MAX(check, om_Opts.MinCheck);
187 check = MIN(check, om_Opts.MaxCheck);
188
189 if (check && _omCheckAddr(addr, size_bin, flags|OM_FUSED, check, omError_NoError, OM_FLR_VAL)) return;
190
191 __omDebugFree(addr,size_bin,flags, OM_FLR_VAL);
192
193#ifdef OM_INTERNAL_DEBUG
194 if (flags & OM_FBIN)
195 (void) _omCheckBin((omBin)size_bin, 1, check-1,omError_InternalBug, OM_FLR);
196 else
198#endif
199}
200
201void* _omDebugMemDup(void* addr, omTrackFlags_t flags, OM_CTFL_DECL)
202{
203 void* ret;
204 size_t sizeW;
205 OM_R_DEF;
206
207 check = MAX(check, om_Opts.MinCheck);
208 track = MAX(track, om_Opts.MinTrack);
209 check = MIN(check, om_Opts.MaxCheck);
210 track = MIN(track, om_Opts.MaxTrack);
211
212 if (check & _omCheckAddr(addr, 0, OM_FUSED, check, omError_NoError, OM_FLR_VAL))
213 {
214 return NULL;
215 }
216 else
217 {
218 sizeW = omSizeWOfAddr(addr);
219 }
220
221 ret = __omDebugAlloc((void*) (sizeW << LOG_SIZEOF_LONG), OM_FSIZE | flags, track, OM_FLR_VAL);
222 omMemcpyW(ret, addr, sizeW);
223
224#ifdef OM_INTERNAL_DEBUG
225 (void) _omCheckAddr(ret, (void*) (sizeW << LOG_SIZEOF_LONG),OM_FUSED|OM_FSIZE,
226 check, omError_InternalBug, OM_FLR);
227#endif
228 return ret;
229}
230
231char* _omDebugStrDup(const char* addr, OM_TFL_DECL)
232{
233#if 0
234 unsigned long size;
235#endif
236 unsigned long i=0;
237 char* ret;
238 OM_R_DEF;
239
240 if (addr == NULL)
241 {
242 omReportAddrError(omError_NotString, omError_NoError, (char *)addr, 0, 0, OM_FLR_VAL, "NULL String");
243 return NULL;
244 }
245 track = MAX(track, om_Opts.MinTrack);
246 track = MIN(track, om_Opts.MaxTrack);
247
248#if 0
249 // this breaks if SizeOfAddr(addr) > PAGESIZE
250 if (omIsBinPageAddr(addr))
251 {
252 size = omSizeOfAddr(addr);
253 }
254 else
255 {
256 size = ULONG_MAX;
257 }
258#endif
259 while ((addr[i] != '\0') /* && (i < size)*/) i++;
260// there seems to be no way to check if it is really a string
261#if 0
262 if (i == size)
263 {
264 omReportAddrError(omError_NotString, omError_NoError, addr, 0, 0, OM_FLR_VAL, "Not 0 terminated");
265 i = size-1;
266 }
267#endif
268 ret = __omDebugAlloc((char*)i+1, OM_FSIZE, track, OM_FLR_VAL);
269 memcpy(ret, addr, i);
270 ret[i] = '\0';
271
272#ifdef OM_INTERNAL_DEBUG
273 (void) _omCheckAddr(ret, (void*)i+1,OM_FUSED|OM_FSIZE,om_Opts.MinCheck, omError_InternalBug, OM_FLR);
274#endif
275 return ret;
276}
277
278omError_t _omDebugAddr(void* addr, void* bin_size, omTrackFlags_t flags, OM_CFL_DECL)
279{
280 OM_R_DEF;
281 check = MAX(check,om_Opts.MinCheck);
282 check = MIN(check,om_Opts.MaxCheck);
283 return _omCheckAddr(addr, bin_size,
285}
287{
288 OM_R_DEF;
289 check = MAX(check,om_Opts.MinCheck);
290 check = MIN(check,om_Opts.MaxCheck);
291 return _omCheckMemory(check, omError_NoError,OM_FLR_VAL);
292}
293omError_t _omDebugBin(omBin bin, OM_CFL_DECL)
294{
295 OM_R_DEF;
296 return _omCheckBin(bin, 1, MAX(check, om_Opts.MinCheck), omError_NoError,OM_FLR_VAL);
297}
298
299/*******************************************************************
300 *
301 * Second level _omDebug alloc/free routines: do the actual work
302 *
303 *******************************************************************/
304static void* __omDebugAlloc(void* size_bin, omTrackFlags_t flags, char track, OM_FLR_DECL)
305{
306 void* o_addr;
307
308#ifdef OM_HAVE_TRACK
309 if (track > 0)
310 {
311 o_addr = omAllocTrackAddr(size_bin, flags, track, OM_FLR_VAL);
312 }
313 else
314#endif
315 {
316 if (flags & OM_FBIN)
317 {
318 omBin bin = (omBin) size_bin;
319
320 if (flags & OM_FZERO)
321 __omTypeAlloc0Bin(void*, o_addr, bin);
322 else
323 __omTypeAllocBin(void*, o_addr, bin);
324 }
325 else
326 {
327 size_t o_size = (flags & OM_FBIN ? ((omBin)size_bin)->sizeW << LOG_SIZEOF_LONG : (size_bin != NULL ? (size_t) size_bin: 1));
328 if (flags & OM_FZERO)
329 {
330#ifdef OM_ALIGNMENT_NEEDS_WORK
331 if (flags & OM_FALIGN)
332 __omTypeAlloc0Aligned(void*, o_addr, o_size);
333 else
334#endif
335 __omTypeAlloc0(void*, o_addr, o_size);
336 }
337 else
338 {
339#ifdef OM_ALIGNMENT_NEEDS_WORK
340 if (flags & OM_FALIGN)
341 __omTypeAllocAligned(void*, o_addr, o_size);
342 else
343#endif
344 __omTypeAlloc(void*, o_addr, o_size);
345 }
346 }
347 }
348
349 return o_addr;
350}
351
352static void* __omDebugRealloc(void* old_addr, void* old_size_bin, void* new_size_bin,
353 omError_t old_status, omTrackFlags_t old_flags, omTrackFlags_t new_flags,
354 char track, OM_FLR_DECL)
355{
356 void* new_addr;
357 size_t old_size = (old_flags & OM_FSIZE ? (size_t) old_size_bin :
358 (omSizeOfAddr(old_addr)));
359 size_t new_size;
360
361 omAssume(new_flags & OM_FSIZE || new_flags & OM_FBIN);
362
363 if (old_addr == NULL || ((old_flags & OM_FSIZE) && old_size_bin == NULL))
364 {
365 new_addr = __omDebugAlloc(new_size_bin, new_flags, track, OM_FLR_VAL);
366 }
367 else if (om_Opts.Keep > 0 || track > 0 || omIsTrackAddr(old_addr) || old_status != omError_NoError ||
368 old_flags & OM_FKEEP || new_flags & OM_FKEEP)
369 {
370 new_addr = __omDebugAlloc(new_size_bin, new_flags, track, OM_FLR_VAL);
371 new_size = omSizeOfAddr(new_addr);
372 old_size = omSizeOfAddr(old_addr);
373
374 memcpy(new_addr, old_addr, (old_size < new_size ? old_size : new_size));
375
376 if ((new_flags & OM_FZERO) && new_size > old_size)
377 memset((char *)new_addr + old_size, 0, new_size - old_size);
378 if (old_status == omError_NoError)
379 __omDebugFree(old_addr, old_size_bin, old_flags, OM_FLR_VAL);
380 }
381 else
382 {
383 if (new_flags & OM_FBIN)
384 {
385 omBin new_bin = (omBin) new_size_bin;
386 omBin old_bin = (omBin) old_size_bin;
387
388 omAssume(old_flags & OM_FBIN);
389 if (new_flags & OM_FZERO)
390 __omTypeRealloc0Bin(old_addr, old_bin, void*, new_addr, new_bin);
391 else
392 __omTypeReallocBin(old_addr, old_bin, void*, new_addr, new_bin);
393 }
394 else
395 {
396 new_size = (size_t) new_size_bin;
397 if (new_size == 0) new_size = 1;
398 omAssume(!(new_flags & OM_FBIN) && !(old_flags & OM_FBIN));
399
400 if (old_flags & OM_FSIZE)
401 {
402 size_t old_size = (size_t) old_size_bin;
403
404 if (new_flags & OM_FZERO)
405 {
406#ifdef OM_ALIGNMENT_NEEDS_WORK
407 if (new_flags & OM_FALIGN)
408 __omTypeRealloc0AlignedSize(old_addr, old_size, void*, new_addr, new_size);
409 else
410#endif
411 __omTypeRealloc0Size(old_addr, old_size, void*, new_addr, new_size);
412 }
413 else
414 {
415#ifdef OM_ALIGNMENT_NEEDS_WORK
416 if (new_flags & OM_FALIGN)
417 __omTypeReallocAlignedSize(old_addr, old_size, void*, new_addr, new_size);
418 else
419#endif
420 __omTypeReallocSize(old_addr, old_size, void*, new_addr, new_size);
421 }
422 }
423 else
424 {
425 if (new_flags & OM_FZERO)
426 {
427#ifdef OM_ALIGNMENT_NEEDS_WORK
428 if (new_flags & OM_FALIGN)
429 __omTypeRealloc0Aligned(old_addr, void*, new_addr, new_size);
430 else
431#endif
432 __omTypeRealloc0(old_addr, void*, new_addr, new_size);
433 }
434 else
435 {
436#ifdef OM_ALIGNMENT_NEEDS_WORK
437 if (new_flags & OM_FALIGN)
438 __omTypeReallocAligned(old_addr, void*, new_addr, new_size);
439 else
440#endif
441 __omTypeRealloc(old_addr, void*, new_addr, new_size);
442 }
443 }
444 }
445 }
446 return new_addr;
447}
448
450{
451 if (omIsBinPageAddr(addr))
452 {
453#ifdef OM_HAVE_TRACK
454 if (omIsBinAddrTrackAddr(addr)) return omGetOrigSpecBinOfTrackAddr(addr);
455 else
456#endif
457 {
458 omBin bin = omGetTopBinOfAddr(addr);
459 if (omIsSpecBin(bin)) return bin;
460 }
461 }
462 return NULL;
463}
464
465static void __omDebugFree(void* addr, void* size_bin, omTrackFlags_t flags, OM_FLR_DECL)
466{
467 omBin bin = NULL;
468
469 if (addr == NULL || ((flags & OM_FSIZE) && size_bin == NULL)) return;
470 if (om_Opts.Keep > 0)
471 {
472#ifdef OM_HAVE_TRACK
473 if (omIsTrackAddr(addr))
474 addr = omMarkAsFreeTrackAddr(addr, 1, &flags, OM_FLR_VAL);
475#endif
476 bin = omGetOrigSpecBinOfAddr(addr);
477 if (bin != NULL)
478 {
479 omSpecBin s_bin = omFindInGList(om_SpecBin, next, bin, (unsigned long) bin);
480 omAssume(s_bin != NULL);
481 (s_bin->ref)++;
482 }
483
484 if (flags & OM_FKEEP)
485 {
486 *((void**) addr) = om_AlwaysKeptAddrs;
487 om_AlwaysKeptAddrs = addr;
488 return;
489 }
490
492 {
497 *((void**) om_LastKeptAddr) = addr;
498 om_LastKeptAddr = addr;
499 *((void**) addr) = NULL;
500 }
501 else
502 {
504 om_LastKeptAddr = addr;
505 om_KeptAddr = addr;
506 *((void**) om_LastKeptAddr) = NULL;
507 }
508
509 if (om_NumberOfKeptAddrs > om_Opts.Keep)
510 {
512 omError_MemoryCorrupted, OM_FLR_VAL);
513 addr = om_KeptAddr;
514 if (addr!=NULL) om_KeptAddr = *((void**) addr);
516 if (status != omError_NoError) return;
517 }
518 else
519 return;
520
521 bin = omGetOrigSpecBinOfAddr(addr);
522 }
523
524#ifdef OM_HAVE_TRACK
525 if (omIsTrackAddr(addr))
526 {
527 omMarkAsFreeTrackAddr(addr, 0, &flags, OM_FLR_VAL);
528 omFreeTrackAddr(addr);
529 }
530 else
531#endif
532 if (om_Opts.Keep <= 0 && ((flags & OM_FBIN) || (flags & OM_FBINADDR)))
533 __omFreeBinAddr(addr);
534 else if (om_Opts.Keep <= 0 && (flags & OM_FSIZE))
535 __omFreeSize(addr, (size_t) size_bin);
536 else
537 __omFree(addr);
538
539 if (bin != NULL) omUnGetSpecBin(&bin);
540}
541
543{
544 void* addr = om_KeptAddr;
545 void* prev_addr = NULL;
546 void* next_addr;
548
549 while (addr != NULL)
550 {
551 next_addr = *((void**) addr);
552 if (omIsBinPageAddr(addr) && omGetTopBinOfAddr(addr) == bin)
553 {
554 if (prev_addr != NULL)
555 *((void**) prev_addr) = next_addr;
556 else
557 om_KeptAddr = next_addr;
558 if (addr == om_LastKeptAddr)
559 om_LastKeptAddr = prev_addr;
561#ifdef OM_HAVE_TRACK
562 if (omIsTrackAddr(addr))
563 {
564 omMarkAsFreeTrackAddr(addr, 0, &flags, OM_FLR);
565 omFreeTrackAddr(addr);
566 }
567 else
568#endif
569 __omFree(addr);
570 addr = next_addr;
571 }
572 else
573 {
574 prev_addr = addr;
575 addr = next_addr;
576 }
577 }
578
579 addr = om_AlwaysKeptAddrs;
580 prev_addr = NULL;
581 while (addr != NULL)
582 {
583 next_addr = *((void**) addr);
584 if (omIsBinPageAddr(addr) && omGetTopBinOfAddr(addr) == bin)
585 {
586 if (prev_addr != NULL)
587 *((void**) prev_addr) = next_addr;
588 else
589 om_AlwaysKeptAddrs = next_addr;
590#ifdef OM_HAVE_TRACK
591 if (omIsTrackAddr(addr))
592 {
593 omMarkAsFreeTrackAddr(addr, 0, &flags, OM_FLR);
594 omFreeTrackAddr(addr);
595 }
596 else
597#endif
598 __omFree(addr);
599 addr = next_addr;
600 }
601 else
602 {
603 prev_addr = addr;
604 addr = next_addr;
605 }
606 }
607}
608
610{
611 void* next;
612 omBin bin;
614 void* addr = om_KeptAddr;
615
616 if (om_LastKeptAddr != NULL)
618
623
624 while (addr != NULL)
625 {
626 next = *((void**)addr);
627 bin = omGetOrigSpecBinOfAddr(addr);
628
629#ifdef OM_HAVE_TRACK
630 if (omIsTrackAddr(addr))
631 {
632 omMarkAsFreeTrackAddr(addr, 0, &flags, OM_FLR);
633 omFreeTrackAddr(addr);
634 }
635 else
636#endif
637 __omFree(addr);
638
639 addr = next;
640 if (bin != NULL) omUnGetSpecBin(&bin);
641 }
642}
643
644#endif /* ! OM_NDEBUG */
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition: cf_ops.cc:600
int i
Definition: cfEzgcd.cc:132
ListNode * next
Definition: janet.h:31
VAR int check
Definition: libparse.cc:1106
#define __omTypeRealloc0Size(old_addr, old_size, new_type, new_addr, new_size)
#define __omTypeReallocBin(old_addr, old_bin, new_type, new_addr, new_bin)
#define __omTypeAlloc0Bin(type, addr, bin)
#define omGetTopBinOfAddr(addr)
#define __omFreeBinAddr(addr)
#define __omTypeRealloc0Bin(old_addr, old_bin, new_type, new_addr, new_bin)
#define __omTypeRealloc(old_addr, new_type, new_addr, new_size)
#define __omTypeRealloc0(old_addr, new_type, new_addr, new_size)
#define __omTypeAllocBin(type, addr, bin)
#define __omTypeRealloc0Aligned
#define __omTypeReallocSize(old_addr, old_size, new_type, new_addr, new_size)
#define __omTypeAlloc0(type, addr, size)
#define __omTypeAlloc(type, addr, size)
#define __omTypeRealloc0AlignedSize
#define __omTypeAllocAligned
#define __omTypeAlloc0Aligned
#define __omFree(addr)
#define __omTypeReallocAligned
#define __omFreeSize(addr, size)
#define __omTypeReallocAlignedSize
size_t omSizeOfAddr(const void *addr)
#define omIsBinPageAddr(addr)
Definition: omBinPage.h:68
#define omIsSpecBin(bin)
Definition: omBin.h:47
#define omUnGetSpecBin(bin_ptr)
Definition: omBin.h:14
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
void * om_AlwaysKeptAddrs
Definition: omDebug.c:31
omError_t omtestAddr(void *addr, int check_level)
Definition: omDebug.c:64
void * _omDebugRealloc(void *old_addr, void *old_size_bin, void *new_size_bin, omTrackFlags_t old_flags, omTrackFlags_t new_flags, OM_CTFL_DECL)
Definition: omDebug.c:147
static omBin omGetOrigSpecBinOfAddr(void *addr)
Definition: omDebug.c:449
omError_t omtestAddrSize(void *addr, size_t size, int check_level)
Definition: omDebug.c:60
void * _omDebugMemDup(void *addr, omTrackFlags_t flags, OM_CTFL_DECL)
Definition: omDebug.c:201
#define MIN(a, b)
Definition: omDebug.c:102
static void * __omDebugAlloc(void *size_bin, omTrackFlags_t flags, char track, OM_FLR_DECL)
Definition: omDebug.c:304
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
static unsigned long om_NumberOfKeptAddrs
Definition: omDebug.c:29
void * _omDebugAlloc(void *size_bin, omTrackFlags_t flags, OM_CTFL_DECL)
Definition: omDebug.c:110
#define OM_CLFL
Definition: omDebug.c:39
omError_t omTestAddrAligned(void *addr, int check_level)
Definition: omDebug.c:77
omError_t _omDebugBin(omBin bin, OM_CFL_DECL)
Definition: omDebug.c:293
void omFreeKeptAddr()
Definition: omDebug.c:609
char * _omDebugStrDup(const char *addr, OM_TFL_DECL)
Definition: omDebug.c:231
void omFreeKeptAddrFromBin(omBin bin)
Definition: omDebug.c:542
omError_t omtestAddrAligned(void *addr, int check_level)
Definition: omDebug.c:85
omError_t _omDebugAddr(void *addr, void *bin_size, omTrackFlags_t flags, OM_CFL_DECL)
Definition: omDebug.c:278
static void * __omDebugRealloc(void *old_addr, void *old_size_bin, void *new_size_bin, omError_t old_status, omTrackFlags_t old_flags, omTrackFlags_t new_flags, char track, OM_FLR_DECL)
Definition: omDebug.c:352
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
static void __omDebugFree(void *addr, void *size_bin, omTrackFlags_t flags, OM_FLR_DECL)
Definition: omDebug.c:465
void * om_KeptAddr
Definition: omDebug.c:28
void * om_LastKeptAddr
Definition: omDebug.c:30
void _omDebugFree(void *addr, void *size_bin, omTrackFlags_t flags, OM_CFL_DECL)
Definition: omDebug.c:182
omError_t omTestAddrAlignedSize(void *addr, size_t size, int check_level)
Definition: omDebug.c:73
omError_t _omDebugMemory(OM_CFL_DECL)
Definition: omDebug.c:286
#define MAX(a, b)
Definition: omDebug.c:100
#define OM_FBINADDR
Definition: omDebug.h:40
#define OM_FSLOPPY
Definition: omDebug.h:39
omError_t _omCheckBin(omBin bin, int normal_bin, char check, omError_t report, OM_FLR_DECL)
Definition: omDebugCheck.c:49
#define OM_FKEPT
Definition: omDebug.h:35
#define OM_FALIGN
Definition: omDebug.h:38
#define OM_FZERO
Definition: omDebug.h:37
#define OM_FSIZE
Definition: omDebug.h:33
omError_t _omCheckAddr(void *addr, void *size_bin, omTrackFlags_t flags, char check, omError_t report, OM_FLR_DECL)
Definition: omDebugCheck.c:36
omError_t omDoCheckAddr(void *addr, void *bin_size, omTrackFlags_t flags, char level, omError_t report, OM_FLR_DECL)
Definition: omDebugCheck.c:146
omError_t _omCheckMemory(char check, omError_t report, OM_FLR_DECL)
Definition: omDebugCheck.c:58
#define OM_FBIN
Definition: omDebug.h:32
omError_t omDoCheckBin(omBin bin, int normal_bin, char level, omError_t report, OM_FLR_DECL)
Definition: omDebugCheck.c:253
unsigned short omTrackFlags_t
Definition: omDebug.h:45
omError_t omReportAddrError(omError_t error, omError_t report, void *addr, void *bin_size, omTrackFlags_t flags, OM_FLR_DECL, const char *fmt,...)
Definition: omDebugCheck.c:394
#define omIsBinAddrTrackAddr(addr)
Definition: omDebug.h:15
#define omIsTrackAddr(addr)
Definition: omDebug.h:12
#define OM_FUSED
Definition: omDebug.h:34
#define OM_FKEEP
Definition: omDebug.h:41
omError_t omReportError(omError_t error, omError_t report_error, OM_FLR_DECL, const char *fmt,...)
Definition: omError.c:80
#define omAssume(x)
Definition: omError.h:85
@ omError_NullSizeAlloc
Definition: omError.h:33
@ omError_MemoryCorrupted
Definition: omError.h:21
@ omError_NotString
Definition: omError.h:40
@ omError_InternalBug
Definition: omError.h:20
@ omError_NoError
Definition: omError.h:18
enum omError_e omError_t
Definition: omError.h:44
#define NULL
Definition: omList.c:12
#define omFindInGList(ptr, next, what, value)
Definition: omList.h:104
#define omMemcpyW(p1, p2, l)
Definition: omMemOps.h:29
omOpts_t om_Opts
Definition: omOpts.c:13
omBin_t * omBin
Definition: omStructs.h:12
omSpecBin_t * omSpecBin
Definition: omStructs.h:30
omSpecBin om_SpecBin
Definition: om_Alloc.c:20
int * status
Definition: si_signals.h:51
int status int void size_t count int const void size_t count const char int flags
Definition: si_signals.h:73
#define omTestBinAddrSize(A, B, C)
Definition: xalloc.h:272
#define omSizeWOfAddr(P)
Definition: xalloc.h:223