Loading...
Searching...
No Matches
omDebug.c
Go to the documentation of this file.
/*******************************************************************
* File: omTest.c
* Purpose: implementation of main omTest functions
* Author: obachman@mathematik.uni-kl.de (Olaf Bachmann)
* Created: 7/00
*******************************************************************/
#include <limits.h>
#include <string.h>
#include "omConfig.h"
#include "omalloc.h"
#include "omDebug.h"
#include "omReturn.h"
#ifndef OM_NDEBUG
/*******************************************************************
*
* Declarations
*
*******************************************************************/
static void* __omDebugAlloc(void* size_bin, omTrackFlags_t flags, char track, OM_FLR_DECL);
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);
static void __omDebugFree(void* addr, void* size_bin, omTrackFlags_t flags, OM_FLR_DECL);
void* om_KeptAddr = NULL;
static unsigned long om_NumberOfKeptAddrs = 0;
void* om_LastKeptAddr = NULL;
void* om_AlwaysKeptAddrs = NULL;
/*******************************************************************
*
* Test routines
*
*******************************************************************/
#define OM_CLFL check_level OM_FL_KOMMA OM_FL
omError_t omTestAddrBin(void* addr, omBin bin, int check_level)
{
return _omDebugAddr(addr,bin,OM_FBIN,OM_CLFL);
}
omError_t omTestBinAddrSize(void* addr, size_t size, int check_level)
{
return _omDebugAddr(addr,(void*)(size),OM_FSIZE|OM_FBINADDR,OM_CLFL);
}
omError_t omTestAddrSize(void* addr, size_t size, int check_level)
{
return _omDebugAddr(addr,(void*)(size),OM_FSIZE,OM_CLFL);
}
omError_t omTestBinAddr(void* addr, int check_level)
{
return _omDebugAddr(addr,NULL, OM_FBINADDR, OM_CLFL);
}
omError_t omTestAddr(void* addr, int check_level)
{
return _omDebugAddr(addr,NULL, 0, OM_CLFL);
}
omError_t omtestAddrSize(void* addr, size_t size, int check_level)
{
return _omDebugAddr(addr,(void*)(size),OM_FSIZE|OM_FSLOPPY,OM_CLFL);
}
omError_t omtestAddr(void* addr, int check_level)
{
return _omDebugAddr(addr,NULL, OM_FSLOPPY, OM_CLFL);
}
omError_t omTestAddrAlignedBin(void* addr, omBin bin, int check_level)
{
return _omDebugAddr(addr,bin,OM_FBIN|OM_FALIGN,OM_CLFL);
}
omError_t omTestAddrAlignedSize(void* addr, size_t size, int check_level)
{
return _omDebugAddr(addr,(void*)(size),OM_FSIZE|OM_FALIGN,OM_CLFL);
}
omError_t omTestAddrAligned(void* addr, int check_level)
{
return _omDebugAddr(addr,NULL, OM_FALIGN, OM_CLFL);
}
omError_t omtestAddrAlignedSize(void* addr, size_t size, int check_level)
{
return _omDebugAddr(addr,(void*)(size),OM_FSIZE|OM_FSLOPPY|OM_FALIGN,OM_CLFL);
}
omError_t omtestAddrAligned(void* addr, int check_level)
{
return _omDebugAddr(addr,NULL, OM_FSLOPPY|OM_FALIGN, OM_CLFL);
}
omError_t omTestBin(omBin bin, int check_level)
{
return _omDebugBin(bin, OM_CLFL);
}
omError_t omTestMemory(int check_level)
{
return _omDebugMemory(OM_CLFL);
}
#undef MAX
#define MAX(a,b) (a > b ? a : b)
#undef MIN
#define MIN(a,b) (a < b ? a : b)
/*******************************************************************
*
* First level _omDebug alloc/free routines: call respective checks and dispatch
* to routines which do the actual work
*
*******************************************************************/
void* _omDebugAlloc(void* size_bin, omTrackFlags_t flags, OM_CTFL_DECL)
{
void* addr;
OM_R_DEF;
check = MAX(check, om_Opts.MinCheck);
track = MAX(track, om_Opts.MinTrack);
check = MIN(check, om_Opts.MaxCheck);
track = MIN(track, om_Opts.MaxTrack);
if (check)
{
if (check > 1)
{
if (flags & OM_FBIN)
(void) _omCheckBin((omBin)size_bin, 1, check-1, omError_MemoryCorrupted, OM_FLR_VAL);
else if (check > 2)
{
omAssume(flags & OM_FSIZE);
(void) _omCheckMemory(check-2, omError_MemoryCorrupted, OM_FLR_VAL);
}
}
if (size_bin == NULL && ! (flags & OM_FSLOPPY))
{
omReportError(omError_NullSizeAlloc, omError_NoError, OM_FLR_VAL, "");
}
}
addr = __omDebugAlloc(size_bin, flags, track, OM_FLR_VAL);
#ifdef OM_INTERNAL_DEBUG
(void) _omCheckAddr(addr, size_bin,flags|OM_FUSED,check, omError_InternalBug, OM_FLR);
#endif
return addr;
}
void* _omDebugRealloc(void* old_addr, void* old_size_bin, void* new_size_bin,
omTrackFlags_t old_flags, omTrackFlags_t new_flags, OM_CTFL_DECL)
{
void* new_addr = NULL;
omError_t status = omError_NoError;
OM_R_DEF;
check = MAX(check, om_Opts.MinCheck);
track = MAX(track, om_Opts.MinTrack);
check = MIN(check, om_Opts.MaxCheck);
track = MIN(track, om_Opts.MaxTrack);
if (check)
{
status = _omCheckAddr(old_addr, old_size_bin, old_flags|OM_FUSED, check, omError_NoError, OM_FLR_VAL);
if (status == omError_NoError && check > 1 && new_flags & OM_FBIN)
status = omDoCheckBin((omBin)new_size_bin, 1, check-1, omError_MemoryCorrupted, OM_FLR_VAL);
if (new_size_bin == NULL && !(new_flags & OM_FSLOPPY))
{
omReportError(omError_NullSizeAlloc, omError_NoError, OM_FLR_VAL, "");
new_size_bin = (void*) 1;
}
}
new_addr = __omDebugRealloc(old_addr, old_size_bin, new_size_bin,
status, old_flags, new_flags, track, OM_FLR_VAL);
#ifdef OM_INTERNAL_DEBUG
if (status == omError_NoError)
(void) _omCheckAddr(new_addr, new_size_bin,new_flags|OM_FUSED,check, omError_InternalBug, OM_FLR);
#endif
return new_addr;
}
void _omDebugFree(void* addr, void* size_bin,
omTrackFlags_t flags, OM_CFL_DECL)
{
OM_R_DEF;
check = MAX(check, om_Opts.MinCheck);
check = MIN(check, om_Opts.MaxCheck);
if (check && _omCheckAddr(addr, size_bin, flags|OM_FUSED, check, omError_NoError, OM_FLR_VAL)) return;
__omDebugFree(addr,size_bin,flags, OM_FLR_VAL);
#ifdef OM_INTERNAL_DEBUG
if (flags & OM_FBIN)
(void) _omCheckBin((omBin)size_bin, 1, check-1,omError_InternalBug, OM_FLR);
else
(void) _omCheckMemory(check-2,omError_InternalBug,OM_FLR);
#endif
}
void* _omDebugMemDup(void* addr, omTrackFlags_t flags, OM_CTFL_DECL)
{
void* ret;
size_t sizeW;
OM_R_DEF;
check = MAX(check, om_Opts.MinCheck);
track = MAX(track, om_Opts.MinTrack);
check = MIN(check, om_Opts.MaxCheck);
track = MIN(track, om_Opts.MaxTrack);
if (check & _omCheckAddr(addr, 0, OM_FUSED, check, omError_NoError, OM_FLR_VAL))
{
return NULL;
}
else
{
sizeW = omSizeWOfAddr(addr);
}
ret = __omDebugAlloc((void*) (sizeW << LOG_SIZEOF_LONG), OM_FSIZE | flags, track, OM_FLR_VAL);
omMemcpyW(ret, addr, sizeW);
#ifdef OM_INTERNAL_DEBUG
(void) _omCheckAddr(ret, (void*) (sizeW << LOG_SIZEOF_LONG),OM_FUSED|OM_FSIZE,
check, omError_InternalBug, OM_FLR);
#endif
return ret;
}
char* _omDebugStrDup(const char* addr, OM_TFL_DECL)
{
#if 0
unsigned long size;
#endif
unsigned long i=0;
char* ret;
OM_R_DEF;
if (addr == NULL)
{
omReportAddrError(omError_NotString, omError_NoError, (char *)addr, 0, 0, OM_FLR_VAL, "NULL String");
return NULL;
}
track = MAX(track, om_Opts.MinTrack);
track = MIN(track, om_Opts.MaxTrack);
#if 0
// this breaks if SizeOfAddr(addr) > PAGESIZE
if (omIsBinPageAddr(addr))
{
size = omSizeOfAddr(addr);
}
else
{
size = ULONG_MAX;
}
#endif
while ((addr[i] != '\0') /* && (i < size)*/) i++;
// there seems to be no way to check if it is really a string
#if 0
if (i == size)
{
omReportAddrError(omError_NotString, omError_NoError, addr, 0, 0, OM_FLR_VAL, "Not 0 terminated");
i = size-1;
}
#endif
ret = __omDebugAlloc((char*)i+1, OM_FSIZE, track, OM_FLR_VAL);
memcpy(ret, addr, i);
ret[i] = '\0';
#ifdef OM_INTERNAL_DEBUG
(void) _omCheckAddr(ret, (void*)i+1,OM_FUSED|OM_FSIZE,om_Opts.MinCheck, omError_InternalBug, OM_FLR);
#endif
return ret;
}
omError_t _omDebugAddr(void* addr, void* bin_size, omTrackFlags_t flags, OM_CFL_DECL)
{
OM_R_DEF;
check = MAX(check,om_Opts.MinCheck);
check = MIN(check,om_Opts.MaxCheck);
return _omCheckAddr(addr, bin_size,
OM_FUSED|flags,check,omError_NoError,OM_FLR_VAL);
}
omError_t _omDebugMemory(OM_CFL_DECL)
{
OM_R_DEF;
check = MAX(check,om_Opts.MinCheck);
check = MIN(check,om_Opts.MaxCheck);
return _omCheckMemory(check, omError_NoError,OM_FLR_VAL);
}
omError_t _omDebugBin(omBin bin, OM_CFL_DECL)
{
OM_R_DEF;
return _omCheckBin(bin, 1, MAX(check, om_Opts.MinCheck), omError_NoError,OM_FLR_VAL);
}
/*******************************************************************
*
* Second level _omDebug alloc/free routines: do the actual work
*
*******************************************************************/
static void* __omDebugAlloc(void* size_bin, omTrackFlags_t flags, char track, OM_FLR_DECL)
{
void* o_addr;
#ifdef OM_HAVE_TRACK
if (track > 0)
{
o_addr = omAllocTrackAddr(size_bin, flags, track, OM_FLR_VAL);
}
else
#endif
{
if (flags & OM_FBIN)
{
omBin bin = (omBin) size_bin;
if (flags & OM_FZERO)
__omTypeAlloc0Bin(void*, o_addr, bin);
else
__omTypeAllocBin(void*, o_addr, bin);
}
else
{
size_t o_size = (flags & OM_FBIN ? ((omBin)size_bin)->sizeW << LOG_SIZEOF_LONG : (size_bin != NULL ? (size_t) size_bin: 1));
if (flags & OM_FZERO)
{
#ifdef OM_ALIGNMENT_NEEDS_WORK
if (flags & OM_FALIGN)
__omTypeAlloc0Aligned(void*, o_addr, o_size);
else
#endif
__omTypeAlloc0(void*, o_addr, o_size);
}
else
{
#ifdef OM_ALIGNMENT_NEEDS_WORK
if (flags & OM_FALIGN)
__omTypeAllocAligned(void*, o_addr, o_size);
else
#endif
__omTypeAlloc(void*, o_addr, o_size);
}
}
}
return o_addr;
}
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)
{
void* new_addr;
size_t old_size = (old_flags & OM_FSIZE ? (size_t) old_size_bin :
(omSizeOfAddr(old_addr)));
size_t new_size;
omAssume(new_flags & OM_FSIZE || new_flags & OM_FBIN);
if (old_addr == NULL || ((old_flags & OM_FSIZE) && old_size_bin == NULL))
{
new_addr = __omDebugAlloc(new_size_bin, new_flags, track, OM_FLR_VAL);
}
else if (om_Opts.Keep > 0 || track > 0 || omIsTrackAddr(old_addr) || old_status != omError_NoError ||
old_flags & OM_FKEEP || new_flags & OM_FKEEP)
{
new_addr = __omDebugAlloc(new_size_bin, new_flags, track, OM_FLR_VAL);
new_size = omSizeOfAddr(new_addr);
old_size = omSizeOfAddr(old_addr);
memcpy(new_addr, old_addr, (old_size < new_size ? old_size : new_size));
if ((new_flags & OM_FZERO) && new_size > old_size)
memset((char *)new_addr + old_size, 0, new_size - old_size);
if (old_status == omError_NoError)
__omDebugFree(old_addr, old_size_bin, old_flags, OM_FLR_VAL);
}
else
{
if (new_flags & OM_FBIN)
{
omBin new_bin = (omBin) new_size_bin;
omBin old_bin = (omBin) old_size_bin;
omAssume(old_flags & OM_FBIN);
if (new_flags & OM_FZERO)
__omTypeRealloc0Bin(old_addr, old_bin, void*, new_addr, new_bin);
else
__omTypeReallocBin(old_addr, old_bin, void*, new_addr, new_bin);
}
else
{
new_size = (size_t) new_size_bin;
if (new_size == 0) new_size = 1;
omAssume(!(new_flags & OM_FBIN) && !(old_flags & OM_FBIN));
if (old_flags & OM_FSIZE)
{
size_t old_size = (size_t) old_size_bin;
if (new_flags & OM_FZERO)
{
#ifdef OM_ALIGNMENT_NEEDS_WORK
if (new_flags & OM_FALIGN)
__omTypeRealloc0AlignedSize(old_addr, old_size, void*, new_addr, new_size);
else
#endif
__omTypeRealloc0Size(old_addr, old_size, void*, new_addr, new_size);
}
else
{
#ifdef OM_ALIGNMENT_NEEDS_WORK
if (new_flags & OM_FALIGN)
__omTypeReallocAlignedSize(old_addr, old_size, void*, new_addr, new_size);
else
#endif
__omTypeReallocSize(old_addr, old_size, void*, new_addr, new_size);
}
}
else
{
if (new_flags & OM_FZERO)
{
#ifdef OM_ALIGNMENT_NEEDS_WORK
if (new_flags & OM_FALIGN)
__omTypeRealloc0Aligned(old_addr, void*, new_addr, new_size);
else
#endif
__omTypeRealloc0(old_addr, void*, new_addr, new_size);
}
else
{
#ifdef OM_ALIGNMENT_NEEDS_WORK
if (new_flags & OM_FALIGN)
__omTypeReallocAligned(old_addr, void*, new_addr, new_size);
else
#endif
__omTypeRealloc(old_addr, void*, new_addr, new_size);
}
}
}
}
return new_addr;
}
static omBin omGetOrigSpecBinOfAddr(void* addr)
{
if (omIsBinPageAddr(addr))
{
#ifdef OM_HAVE_TRACK
if (omIsBinAddrTrackAddr(addr)) return omGetOrigSpecBinOfTrackAddr(addr);
else
#endif
{
omBin bin = omGetTopBinOfAddr(addr);
if (omIsSpecBin(bin)) return bin;
}
}
return NULL;
}
static void __omDebugFree(void* addr, void* size_bin, omTrackFlags_t flags, OM_FLR_DECL)
{
omBin bin = NULL;
if (addr == NULL || ((flags & OM_FSIZE) && size_bin == NULL)) return;
if (om_Opts.Keep > 0)
{
#ifdef OM_HAVE_TRACK
if (omIsTrackAddr(addr))
addr = omMarkAsFreeTrackAddr(addr, 1, &flags, OM_FLR_VAL);
#endif
bin = omGetOrigSpecBinOfAddr(addr);
if (bin != NULL)
{
omSpecBin s_bin = omFindInGList(om_SpecBin, next, bin, (unsigned long) bin);
omAssume(s_bin != NULL);
(s_bin->ref)++;
}
if (flags & OM_FKEEP)
{
*((void**) addr) = om_AlwaysKeptAddrs;
om_AlwaysKeptAddrs = addr;
return;
}
if (om_NumberOfKeptAddrs)
{
omAssume(om_KeptAddr != NULL && om_LastKeptAddr != NULL &&
((om_NumberOfKeptAddrs == 1 && om_LastKeptAddr == om_KeptAddr) ||
(om_NumberOfKeptAddrs != 1 && om_LastKeptAddr != om_KeptAddr)));
om_NumberOfKeptAddrs++;
*((void**) om_LastKeptAddr) = addr;
om_LastKeptAddr = addr;
*((void**) addr) = NULL;
}
else
{
om_NumberOfKeptAddrs = 1;
om_LastKeptAddr = addr;
om_KeptAddr = addr;
*((void**) om_LastKeptAddr) = NULL;
}
if (om_NumberOfKeptAddrs > om_Opts.Keep)
{
omError_t status = omDoCheckAddr(om_KeptAddr, NULL, OM_FKEPT, om_Opts.MinCheck,
omError_MemoryCorrupted, OM_FLR_VAL);
addr = om_KeptAddr;
if (addr!=NULL) om_KeptAddr = *((void**) addr);
om_NumberOfKeptAddrs--;
if (status != omError_NoError) return;
}
else
return;
bin = omGetOrigSpecBinOfAddr(addr);
}
#ifdef OM_HAVE_TRACK
if (omIsTrackAddr(addr))
{
omMarkAsFreeTrackAddr(addr, 0, &flags, OM_FLR_VAL);
omFreeTrackAddr(addr);
}
else
#endif
if (om_Opts.Keep <= 0 && ((flags & OM_FBIN) || (flags & OM_FBINADDR)))
__omFreeBinAddr(addr);
else if (om_Opts.Keep <= 0 && (flags & OM_FSIZE))
__omFreeSize(addr, (size_t) size_bin);
else
__omFree(addr);
if (bin != NULL) omUnGetSpecBin(&bin);
}
void omFreeKeptAddrFromBin(omBin bin)
{
void* addr = om_KeptAddr;
void* prev_addr = NULL;
void* next_addr;
omTrackFlags_t flags;
while (addr != NULL)
{
next_addr = *((void**) addr);
if (omIsBinPageAddr(addr) && omGetTopBinOfAddr(addr) == bin)
{
if (prev_addr != NULL)
*((void**) prev_addr) = next_addr;
else
om_KeptAddr = next_addr;
if (addr == om_LastKeptAddr)
om_LastKeptAddr = prev_addr;
om_NumberOfKeptAddrs--;
#ifdef OM_HAVE_TRACK
if (omIsTrackAddr(addr))
{
omMarkAsFreeTrackAddr(addr, 0, &flags, OM_FLR);
omFreeTrackAddr(addr);
}
else
#endif
__omFree(addr);
addr = next_addr;
}
else
{
prev_addr = addr;
addr = next_addr;
}
}
addr = om_AlwaysKeptAddrs;
prev_addr = NULL;
while (addr != NULL)
{
next_addr = *((void**) addr);
if (omIsBinPageAddr(addr) && omGetTopBinOfAddr(addr) == bin)
{
if (prev_addr != NULL)
*((void**) prev_addr) = next_addr;
else
om_AlwaysKeptAddrs = next_addr;
#ifdef OM_HAVE_TRACK
if (omIsTrackAddr(addr))
{
omMarkAsFreeTrackAddr(addr, 0, &flags, OM_FLR);
omFreeTrackAddr(addr);
}
else
#endif
__omFree(addr);
addr = next_addr;
}
else
{
prev_addr = addr;
addr = next_addr;
}
}
}
void omFreeKeptAddr()
{
void* next;
omBin bin;
omTrackFlags_t flags;
void* addr = om_KeptAddr;
if (om_LastKeptAddr != NULL)
*((void**) om_LastKeptAddr) = om_AlwaysKeptAddrs;
om_NumberOfKeptAddrs = 0;
om_LastKeptAddr = NULL;
om_AlwaysKeptAddrs = NULL;
om_KeptAddr = NULL;
while (addr != NULL)
{
next = *((void**)addr);
bin = omGetOrigSpecBinOfAddr(addr);
#ifdef OM_HAVE_TRACK
if (omIsTrackAddr(addr))
{
omMarkAsFreeTrackAddr(addr, 0, &flags, OM_FLR);
omFreeTrackAddr(addr);
}
else
#endif
__omFree(addr);
addr = next;
if (bin != NULL) omUnGetSpecBin(&bin);
}
}
#endif /* ! OM_NDEBUG */
size
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition cf_ops.cc:600
i
int i
Definition cfEzgcd.cc:132
next
ListNode * next
Definition janet.h:31
check
VAR int check
Definition libparse.cc:1106
__omTypeRealloc0Size
#define __omTypeRealloc0Size(old_addr, old_size, new_type, new_addr, new_size)
Definition omAllocPrivate.h:354
__omTypeReallocBin
#define __omTypeReallocBin(old_addr, old_bin, new_type, new_addr, new_bin)
Definition omAllocPrivate.h:172
__omTypeAlloc0Bin
#define __omTypeAlloc0Bin(type, addr, bin)
Definition omAllocPrivate.h:154
omGetTopBinOfAddr
#define omGetTopBinOfAddr(addr)
Definition omAllocPrivate.h:78
__omFreeBinAddr
#define __omFreeBinAddr(addr)
Definition omAllocPrivate.h:163
__omTypeRealloc0Bin
#define __omTypeRealloc0Bin(old_addr, old_bin, new_type, new_addr, new_bin)
Definition omAllocPrivate.h:190
__omTypeRealloc
#define __omTypeRealloc(old_addr, new_type, new_addr, new_size)
Definition omAllocPrivate.h:348
__omTypeRealloc0
#define __omTypeRealloc0(old_addr, new_type, new_addr, new_size)
Definition omAllocPrivate.h:350
__omTypeAllocBin
#define __omTypeAllocBin(type, addr, bin)
Definition omAllocPrivate.h:143
__omTypeRealloc0Aligned
#define __omTypeRealloc0Aligned
Definition omAllocPrivate.h:368
__omTypeReallocSize
#define __omTypeReallocSize(old_addr, old_size, new_type, new_addr, new_size)
Definition omAllocPrivate.h:352
__omTypeAlloc0
#define __omTypeAlloc0(type, addr, size)
Definition omAllocPrivate.h:229
__omTypeAlloc
#define __omTypeAlloc(type, addr, size)
Definition omAllocPrivate.h:213
__omTypeRealloc0AlignedSize
#define __omTypeRealloc0AlignedSize
Definition omAllocPrivate.h:370
__omTypeAllocAligned
#define __omTypeAllocAligned
Definition omAllocPrivate.h:280
__omTypeAlloc0Aligned
#define __omTypeAlloc0Aligned
Definition omAllocPrivate.h:281
__omFree
#define __omFree(addr)
Definition omAllocPrivate.h:298
__omTypeReallocAligned
#define __omTypeReallocAligned
Definition omAllocPrivate.h:367
__omFreeSize
#define __omFreeSize(addr, size)
Definition omAllocPrivate.h:284
__omTypeReallocAlignedSize
#define __omTypeReallocAlignedSize
Definition omAllocPrivate.h:369
omSizeOfAddr
size_t omSizeOfAddr(const void *addr)
Definition omAllocSystem.c:110
omIsBinPageAddr
#define omIsBinPageAddr(addr)
Definition omBinPage.h:68
omIsSpecBin
#define omIsSpecBin(bin)
Definition omBin.h:47
omUnGetSpecBin
#define omUnGetSpecBin(bin_ptr)
Definition omBin.h:14
omTestBinAddr
omError_t omTestBinAddr(void *addr, int check_level)
Definition omDebug.c:52
omTestBin
omError_t omTestBin(omBin bin, int check_level)
Definition omDebug.c:90
omTestAddrSize
omError_t omTestAddrSize(void *addr, size_t size, int check_level)
Definition omDebug.c:48
om_AlwaysKeptAddrs
void * om_AlwaysKeptAddrs
Definition omDebug.c:31
omtestAddr
omError_t omtestAddr(void *addr, int check_level)
Definition omDebug.c:64
_omDebugRealloc
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
omGetOrigSpecBinOfAddr
static omBin omGetOrigSpecBinOfAddr(void *addr)
Definition omDebug.c:449
omtestAddrSize
omError_t omtestAddrSize(void *addr, size_t size, int check_level)
Definition omDebug.c:60
_omDebugMemDup
void * _omDebugMemDup(void *addr, omTrackFlags_t flags, OM_CTFL_DECL)
Definition omDebug.c:201
MIN
#define MIN(a, b)
Definition omDebug.c:102
__omDebugAlloc
static void * __omDebugAlloc(void *size_bin, omTrackFlags_t flags, char track, OM_FLR_DECL)
Definition omDebug.c:304
omTestMemory
omError_t omTestMemory(int check_level)
Definition omDebug.c:94
omtestAddrAlignedSize
omError_t omtestAddrAlignedSize(void *addr, size_t size, int check_level)
Definition omDebug.c:81
omTestAddr
omError_t omTestAddr(void *addr, int check_level)
Definition omDebug.c:56
om_NumberOfKeptAddrs
static unsigned long om_NumberOfKeptAddrs
Definition omDebug.c:29
_omDebugAlloc
void * _omDebugAlloc(void *size_bin, omTrackFlags_t flags, OM_CTFL_DECL)
Definition omDebug.c:110
OM_CLFL
#define OM_CLFL
Definition omDebug.c:39
omTestAddrAligned
omError_t omTestAddrAligned(void *addr, int check_level)
Definition omDebug.c:77
_omDebugBin
omError_t _omDebugBin(omBin bin, OM_CFL_DECL)
Definition omDebug.c:293
omFreeKeptAddr
void omFreeKeptAddr()
Definition omDebug.c:609
_omDebugStrDup
char * _omDebugStrDup(const char *addr, OM_TFL_DECL)
Definition omDebug.c:231
omFreeKeptAddrFromBin
void omFreeKeptAddrFromBin(omBin bin)
Definition omDebug.c:542
omtestAddrAligned
omError_t omtestAddrAligned(void *addr, int check_level)
Definition omDebug.c:85
_omDebugAddr
omError_t _omDebugAddr(void *addr, void *bin_size, omTrackFlags_t flags, OM_CFL_DECL)
Definition omDebug.c:278
__omDebugRealloc
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
omTestAddrBin
omError_t omTestAddrBin(void *addr, omBin bin, int check_level)
Definition omDebug.c:40
omTestAddrAlignedBin
omError_t omTestAddrAlignedBin(void *addr, omBin bin, int check_level)
Definition omDebug.c:69
__omDebugFree
static void __omDebugFree(void *addr, void *size_bin, omTrackFlags_t flags, OM_FLR_DECL)
Definition omDebug.c:465
om_KeptAddr
void * om_KeptAddr
Definition omDebug.c:28
om_LastKeptAddr
void * om_LastKeptAddr
Definition omDebug.c:30
_omDebugFree
void _omDebugFree(void *addr, void *size_bin, omTrackFlags_t flags, OM_CFL_DECL)
Definition omDebug.c:182
omTestAddrAlignedSize
omError_t omTestAddrAlignedSize(void *addr, size_t size, int check_level)
Definition omDebug.c:73
_omDebugMemory
omError_t _omDebugMemory(OM_CFL_DECL)
Definition omDebug.c:286
MAX
#define MAX(a, b)
Definition omDebug.c:100
omDebug.h
OM_FBINADDR
#define OM_FBINADDR
Definition omDebug.h:40
OM_FSLOPPY
#define OM_FSLOPPY
Definition omDebug.h:39
_omCheckBin
omError_t _omCheckBin(omBin bin, int normal_bin, char check, omError_t report, OM_FLR_DECL)
Definition omDebugCheck.c:49
OM_FKEPT
#define OM_FKEPT
Definition omDebug.h:35
OM_FALIGN
#define OM_FALIGN
Definition omDebug.h:38
OM_FZERO
#define OM_FZERO
Definition omDebug.h:37
OM_FSIZE
#define OM_FSIZE
Definition omDebug.h:33
_omCheckAddr
omError_t _omCheckAddr(void *addr, void *size_bin, omTrackFlags_t flags, char check, omError_t report, OM_FLR_DECL)
Definition omDebugCheck.c:36
omDoCheckAddr
omError_t omDoCheckAddr(void *addr, void *bin_size, omTrackFlags_t flags, char level, omError_t report, OM_FLR_DECL)
Definition omDebugCheck.c:146
_omCheckMemory
omError_t _omCheckMemory(char check, omError_t report, OM_FLR_DECL)
Definition omDebugCheck.c:58
OM_FBIN
#define OM_FBIN
Definition omDebug.h:32
omDoCheckBin
omError_t omDoCheckBin(omBin bin, int normal_bin, char level, omError_t report, OM_FLR_DECL)
Definition omDebugCheck.c:253
omTrackFlags_t
unsigned short omTrackFlags_t
Definition omDebug.h:45
omReportAddrError
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
omIsBinAddrTrackAddr
#define omIsBinAddrTrackAddr(addr)
Definition omDebug.h:15
omIsTrackAddr
#define omIsTrackAddr(addr)
Definition omDebug.h:12
OM_FUSED
#define OM_FUSED
Definition omDebug.h:34
OM_FKEEP
#define OM_FKEEP
Definition omDebug.h:41
omReportError
omError_t omReportError(omError_t error, omError_t report_error, OM_FLR_DECL, const char *fmt,...)
Definition omError.c:80
omAssume
#define omAssume(x)
Definition omError.h:85
omError_NullSizeAlloc
@ omError_NullSizeAlloc
Definition omError.h:33
omError_MemoryCorrupted
@ omError_MemoryCorrupted
Definition omError.h:21
omError_NotString
@ omError_NotString
Definition omError.h:40
omError_InternalBug
@ omError_InternalBug
Definition omError.h:20
omError_NoError
@ omError_NoError
Definition omError.h:18
omError_t
enum omError_e omError_t
Definition omError.h:44
NULL
#define NULL
Definition omList.c:12
omFindInGList
#define omFindInGList(ptr, next, what, value)
Definition omList.h:104
omMemcpyW
#define omMemcpyW(p1, p2, l)
Definition omMemOps.h:29
om_Opts
omOpts_t om_Opts
Definition omOpts.c:13
omReturn.h
omBin
omBin_t * omBin
Definition omStructs.h:12
omSpecBin
omSpecBin_t * omSpecBin
Definition omStructs.h:30
om_SpecBin
omSpecBin om_SpecBin
Definition om_Alloc.c:20
omalloc.h
status
int * status
Definition si_signals.h:61
flags
int status int void size_t count const char int flags
Definition si_signals.h:83
omTestBinAddrSize
#define omTestBinAddrSize(A, B, C)
Definition xalloc.h:272
omSizeWOfAddr
#define omSizeWOfAddr(P)
Definition xalloc.h:223