11#if defined(OM_NDEBUG) || ! defined(OM_HAVE_TRACK)
12#define omIsTrackAddr(addr) 0
13#define omIsTrackAddrPage(page) 0
14#define omIsNormalBinPageAddr(addr) omIsBinPageAddr(addr)
15#define omIsBinAddrTrackAddr(addr) 0
17#define omIsTrackAddrBinPage(bin_page) ((bin_page)->used_blocks < 0)
18#define omIsBinAddrTrackAddr(addr) omIsTrackAddrBinPage(omGetBinPageOfAddr(addr))
19#define omIsTrackAddr(addr) (omIsBinPageAddr(addr) && omIsBinAddrTrackAddr(addr))
20#define omIsNormalBinPageAddr(addr) (omIsBinPageAddr(addr) && !omIsBinAddrTrackAddr(addr))
24#define omMarkAsStaticAddr(addr) do {} while (0)
25#define omMarkMemoryAsStatic() do {} while (0)
26#define omUnMarkAsStaticAddr() do {} while (0)
27#define omUnMarkMemoryAsStatic() do {} while (0)
28#define omFreeKeptAddr() do {} while (0)
29#define omPrintUsedAddrs(fd,m) do {} while (0)
30#define omPrintUsedTrackAddrs(fd,m) do {} while (0)
40#define OM_FBINADDR 256
44#define OM_FMAX 1024 - OM_FBIN - OM_FUSED
48void*
_omDebugRealloc(
void* old_addr,
void* old_size_bin,
void* new_size_bin,
71#define omSetCustomOfAddr(addr,value) do {} while (0)
72#define omGetCustomOfAddr(addr) ((void*)0)
73#define omSetCustomOfTrackAddr(addr,value) do {} while (0)
74#define omGetCustomOfTrackAddr(addr) ((void*)0)
76void omSetCustomOfTrackAddr(
void* addr,
void* value);
77void* omGetCustomOfTrackAddr(
void* addr);
78#define omSetCustomOfAddr(addr,value) \
79 do{if (omIsTrackAddr(addr)) omSetCustomOfTrackAddr(addr,value);}while(0)
80#define omGetCustomOfAddr(addr) \
81 (omIsTrackAddr(addr) ? omGetCustomOfTrackAddr(addr) : NULL)
87#if defined(OM_NDEBUG) || ! defined(OM_HAVE_TRACK)
88#define omGetUsedBlocksOfPage(page) (page->used_blocks)
90#define omGetUsedBlocksOfPage(page) ((long)(page->used_blocks & ~(((unsigned long) 1) << (BIT_SIZEOF_LONG -1))))
115 OM_FLR_DECL,
const char* fmt, ...);
118void omIterateTroughAddrs(
int normal,
int track,
void (*CallBackUsed)(
void*),
void (*CallBackFree)(
void*));
130extern omBin_t om_StaticTrackBin[];
131extern omBin om_Size2TrackBin[];
132#define omSmallSize2TrackBin(size) om_Size2TrackBin[((size) -1)>>LOG_SIZEOF_OM_ALIGNMENT]
134extern void omFreeTrackAddr(
void* addr);
135extern size_t omOutSizeOfTrackAddr(
void* addr);
142void omPrintTrackAddrInfo(FILE*
fd,
void* addr,
int max_frames);
143omBin omGetOrigSpecBinOfTrackAddr(
void* addr);
144size_t omOutSizeOfTrackAddr(
void* addr);
146#define omSetTrackOfUsedBlocks(ub) (ub |= (((unsigned long) 1) << (BIT_SIZEOF_LONG -1)))
147#define omUnsetTrackOfUsedBlocks(ub) (ub &= ~(((unsigned long) 1) << (BIT_SIZEOF_LONG -1)))
148#define omIsSetTrackOfUsedBlocks(ub) (ub & (((unsigned long) 1) << (BIT_SIZEOF_LONG -1)))
150#define omIsStaticTrackAddr(addr) 0
170#define omCheckReturn(cond) \
171 do {omError_t _status = cond; if (_status) return _status;} while (0)
172#define omCheckReturnError(cond, error) \
173 do {if (cond) return omReportError(error, report, OM_FLR_VAL, "");} while (0)
174#define omCheckReturnCorrupted(cond) \
175 omCheckReturnError(cond, omError_MemoryCorrupted)
176#define omAddrCheckReturn(cond) \
179 omError_t _status = cond; \
180 if (_status && (_status != omError_MaxError)) \
182 _omPrintAddrInfo(stderr, _status, addr, bin_size, flags, 10, " occurred for"); \
186#define omAddrCheckReturnError(cond, error) \
187 do {if (cond) return omReportAddrError(error, report, addr, bin_size, flags, OM_FLR_VAL, "");} while (0)
188#define omAddrCheckReturnCorrupted(cond) \
189 omAddrCheckReturnError(cond, omError_MemoryCorrupted)
192#define omFreeKeptAddrFromBin(bin) do {} while (0)
void omUnMarkMemoryAsStatic()
void * om_AlwaysKeptAddrs
omError_t omCheckBinPageRegions(int level, omError_t report, OM_FLR_DECL)
omError_t _omCheckBin(omBin bin, int normal_bin, char check, omError_t report, OM_FLR_DECL)
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 * _omDebugMemDup(void *addr, omTrackFlags_t flags, OM_CTFL_DECL)
void * omAddr_2_OutAddr(void *addr)
void * _omDebugAlloc(void *size_bin, omTrackFlags_t flags, OM_CTFL_DECL)
omError_t _omCheckAddr(void *addr, void *size_bin, omTrackFlags_t flags, char check, omError_t report, OM_FLR_DECL)
omError_t omDoCheckAddr(void *addr, void *bin_size, omTrackFlags_t flags, char level, omError_t report, OM_FLR_DECL)
void omMarkMemoryAsStatic()
omBinPageRegion omFindRegionOfAddr(void *addr)
omError_t _omCheckMemory(char check, omError_t report, OM_FLR_DECL)
omError_t _omDebugBin(omBin bin, OM_CFL_DECL)
omError_t omDoCheckBin(omBin bin, int normal_bin, char level, omError_t report, OM_FLR_DECL)
omError_t omCheckPtr(const void *ptr, omError_t report, OM_FLR_DECL)
int omIsKnownMemoryRegion(omBinPageRegion region)
void omIterateTroughBinAddrs(omBin bin, void(*CallBackUsed)(void *), void(*CallBackFree)(void *))
unsigned short omTrackFlags_t
char * _omDebugStrDup(const char *addr, OM_TFL_DECL)
#define omIsStaticTrackAddr(addr)
omError_t omCheckBinPageRegion(omBinPageRegion region, int level, omError_t report, OM_FLR_DECL)
void omFreeKeptAddrFromBin(omBin bin)
omError_t _omDebugAddr(void *addr, void *bin_size, omTrackFlags_t flags, OM_CFL_DECL)
omError_t omReportAddrError(omError_t error, omError_t report, void *addr, void *bin_size, omTrackFlags_t flags, OM_FLR_DECL, const char *fmt,...)
void omIterateTroughAddrs(int normal, int track, void(*CallBackUsed)(void *), void(*CallBackFree)(void *))
int omIsAddrOnFreeBinPage(void *addr)
void omUnMarkAsStaticAddr(void *addr)
omError_t omDoCheckBinAddr(void *addr, void *bin_size, omTrackFlags_t flags, char level, omError_t report, OM_FLR_DECL)
void _omDebugFree(void *addr, void *size_bin, omTrackFlags_t flags, OM_CFL_DECL)
int omIsInKeptAddrList(void *addr)
omError_t _omDebugMemory(OM_CFL_DECL)
omBinPageRegion_t * omBinPageRegion
int status int void size_t count int const void size_t count const char int flags
#define omPrintUsedAddrs(F, max)
#define omMarkAsStaticAddr(A)
#define omPrintUsedTrackAddrs(F, max)