68 for (
i=0;
i<= OM_MAX_BIN_INDEX;
i++)
83 while (sticky !=
NULL)
86 sticky = sticky->next;
90 for (
i=0;
i<= OM_MAX_BIN_INDEX;
i++)
94 s_bin = om_SpecTrackBin;
112 addr = *((
void**) addr);
122 addr = *((
void**) addr);
166 return omCheckTrackAddr(addr, bin_size,
flags,
level, report, OM_FLR_VAL);
233 ( ( ( (
unsigned long) addr)
234 - ((
unsigned long) page)
236 % (bin->sizeW * SIZEOF_VOIDP)
245 size_t size = (size_t) bin_size;
280 bin->max_blocks != top_bin->max_blocks);
282 if (
level <= 1)
continue;
293 page = bin->last_page;
298 omCheckReturn(page != bin->last_page && page != bin->current_page &&
302 (page->next ==
NULL || page->next->prev != page));
316 if (page == bin->current_page)
358 if (bin->max_blocks > 1)
362 page->current !=
NULL);
374 void* current = page->current;
379 while (current !=
NULL)
384 - ((
unsigned long) page)
386 % (bin->sizeW * SIZEOF_LONG)
388 current = *((
void**) current);
395 OM_FLR_DECL,
const char* fmt, ...)
397 int max_check, max_track;
430 fputs(
" unaligned",
fd);
433 fprintf(
fd,
" specified size:%ld", (
long) bin_size);
436 fprintf(
fd,
" specified bin is of size:%ld",
437 (
long)((
omBin) bin_size)->sizeW << LOG_SIZEOF_LONG);
440 omPrintTrackAddrInfo(
fd, addr, frames);
443 fputs(
" !omIsTrackAddr\n",
fd);
444 omPrintTrackAddrInfo(
fd, addr, frames);
449 fprintf(
fd,
"%s (invalid) addr: %p (error=%d)\n",
s, addr,
x);
473 page = bin->last_page;
484 if (CallBackFree !=
NULL) CallBackFree(addr);
488 if (CallBackUsed !=
NULL) CallBackUsed(addr);
490 addr = (
char *)((
char**) addr) + bin->sizeW;
492 }
while (i < bin->max_blocks);
499 }
while (bin !=
NULL);
511 for (
i=0;
i<=OM_MAX_BIN_INDEX;
i++)
516 while (s_bin !=
NULL)
526 for (
i=0;
i<=OM_MAX_BIN_INDEX;
i++)
530 s_bin = om_SpecTrackBin;
531 while (s_bin !=
NULL)
539 while (sticky !=
NULL)
542 sticky = sticky->next;
572 fprintf(
fd,
"UsedAddrs Summary: UsedBlocks:%ld TotalSize:%ld\n",
583 fprintf(
fd,
"UsedTrackAddrs Summary: UsedBlocks:%ld TotalSize:%ld\n",
const CanonicalForm int s
static int max(int a, int b)
#define omGetTopBinOfAddr(addr)
#define SIZEOF_OM_BIN_PAGE_HEADER
#define omGetTopBinOfPage(page)
#define omGetBinOfAddr(addr)
#define omGetStickyOfPage(page)
size_t omSizeOfLargeAddr(void *addr)
size_t omSizeOfAddr(const void *addr)
omError_t omCheckBinPageRegions(int level, omError_t report, OM_FLR_DECL)
omBinPageRegion omFindRegionOfAddr(void *addr)
int omIsAddrOnFreeBinPage(void *addr)
#define omGetBinPageOfAddr(addr)
#define omIsBinPageAddr(addr)
#define omIsAddrPageAligned(addr)
#define omGetPageOfAddr(addr)
#define omIsKnownTopBin(bin, normal_bin)
#define omIsStickyBin(bin)
static omError_t omDoCheckLargeAddr(void *addr, void *bin_size, omTrackFlags_t flags, char level, omError_t report, OM_FLR_DECL)
static FILE * om_print_used_addr_fd
omError_t _omCheckBin(omBin bin, int what_bin, char check, omError_t report, OM_FLR_DECL)
static omError_t omDoCheckBinPage(omBinPage page, int normal_page, int level, omError_t report, OM_FLR_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)
omError_t omReportAddrError(omError_t error, omError_t report_error, void *addr, void *bin_size, omTrackFlags_t flags, OM_FLR_DECL, const char *fmt,...)
static void _omPrintUsedAddr(void *addr)
omError_t _omCheckMemory(char check, omError_t report, OM_FLR_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)
void omIterateTroughBinAddrs(omBin bin, void(*CallBackUsed)(void *), void(*CallBackFree)(void *))
static size_t om_total_used_size
static unsigned long om_total_used_blocks
void omIterateTroughAddrs(int normal, int track, void(*CallBackUsed)(void *), void(*CallBackFree)(void *))
static int om_print_frames
omError_t omDoCheckBinAddr(void *addr, void *bin_size, omTrackFlags_t flags, char level, omError_t report, OM_FLR_DECL)
static void _omPrintAddrInfo(FILE *fd, omError_t error, void *addr, void *bin_size, omTrackFlags_t flags, int max_frames, const char *s)
void * om_AlwaysKeptAddrs
#define omGetUsedBlocksOfPage(page)
#define omAddrCheckReturnError(cond, error)
unsigned short omTrackFlags_t
#define omIsStaticTrackAddr(addr)
#define omCheckReturnError(cond, error)
#define omAddrCheckReturn(cond)
#define omCheckReturnCorrupted(cond)
#define omIsBinAddrTrackAddr(addr)
#define omIsTrackAddr(addr)
#define omAddrCheckReturnCorrupted(cond)
#define omCheckReturn(cond)
int omIsInKeptAddrList(void *addr)
omError_t omReportError(omError_t error, omError_t report_error, OM_FLR_DECL, const char *fmt,...)
@ omError_MemoryCorrupted
@ omError_FreedAddrOrMemoryCorrupted
@ omError_KeptAddrListCorrupted
@ omError_InvalidRangeAddr
@ omError_FalseAddrOrMemoryCorrupted
OM_INLINE_DECL omBin omGetBinOfPage(omBinPage page)
#define omIsOnList(ptr, addr)
#define omFindInGList(ptr, next, what, value)
#define omCheckGList(ptr, next, level, report, OM_FLR_VAL)
#define omGListLength(ptr, next)
#define omListLength(ptr)
#define omGListLast(ptr, next)
#define omIsOnGList(ptr, next, addr)
#define omCheckList(ptr, level, report, OM_FLR_VAL)
omBinPageRegion_t * omBinPageRegion
#define OM_MAX_BLOCK_SIZE
omBinPage_t om_ZeroPage[]
int status int void size_t count int const void size_t count const char int flags
#define omPrintAddrInfo(A, B, C)
#define omPrintUsedAddrs(F, max)
#define omPrintUsedTrackAddrs(F, max)