 |
My Project
UNKNOWN_GIT_VERSION
|
Go to the source code of this file.
|
omBin | _omGetSpecBin (size_t size, int align, int track) |
|
void | _omUnGetSpecBin (omBin *bin_p, int force) |
|
static omBin | omCreateStickyBin (omBin bin, unsigned long sticky) |
|
unsigned long | omGetMaxStickyBinTag (omBin bin) |
|
unsigned long | omGetNewStickyBinTag (omBin bin) |
|
void | omSetStickyBinTag (omBin bin, unsigned long sticky_tag) |
|
void | omUnSetStickyBinTag (omBin bin, unsigned long sticky) |
|
static void | omMergeStickyPages (omBin to_bin, omBin from_bin) |
|
void | omDeleteStickyBinTag (omBin bin, unsigned long sticky) |
|
omBin | omGetStickyBinOfBin (omBin bin) |
|
void | omMergeStickyBinIntoBin (omBin sticky_bin, omBin into_bin) |
|
int | omIsKnownTopBin (omBin bin, int normal_bin) |
|
unsigned long | omGetNewStickyAllBinTag () |
|
void | omSetStickyAllBinTag (unsigned long sticky) |
|
void | omUnSetStickyAllBinTag (unsigned long sticky) |
|
void | omDeleteStickyAllBinTag (unsigned long sticky) |
|
static void | omGetBinStat (omBin bin, long *pages_p, long *used_blocks_p, long *free_blocks_p) |
|
static void | omGetTotalBinStat (omBin bin, long *pages_p, long *used_blocks_p, long *free_blocks_p) |
|
static void | omPrintBinStat (FILE *fd, omBin bin, int track, long *pages, long *used_blocks, long *free_blocks) |
|
void | omPrintBinStats (FILE *fd) |
|
static long | omGetUsedBytesOfBin (omBin bin) |
|
long | omGetUsedBinBytes () |
|
◆ om_LargeBin
#define om_LargeBin ((omBin) 1) |
◆ omGetStickyBin
#define omGetStickyBin |
( |
|
bin, |
|
|
|
sticky_tag |
|
) |
| omFindInGList(bin, next, sticky, sticky_tag) |
◆ _omGetSpecBin()
omBin _omGetSpecBin |
( |
size_t |
size, |
|
|
int |
align, |
|
|
int |
track |
|
) |
| |
Definition at line 22 of file omBin.c.
33 #ifdef OM_ALIGNMENT_NEEDS_WORK
49 sizeW = ((-max_blocks*SIZEOF_SYSTEM_PAGE) -
59 #ifdef OM_ALIGNMENT_NEEDS_WORK
61 sizeW = ((
size + sizeW) & ~ (SIZEOF_STRICT_ALIGNMENT - 1));
64 sizeW = ((
size + sizeW) & ~ (SIZEOF_OM_ALIGNMENT - 1));
71 sizeW = sizeW >> LOG_SIZEOF_LONG;
76 #ifdef OM_ALIGNMENT_NEEDS_WORK
85 om_new_specBin = omSmallSize2TrackBin(
size );
95 om_new_specBin->max_blocks < max_blocks)
109 s_bin->bin->max_blocks == s_bin->max_blocks &&
110 s_bin->bin->sizeW == sizeW);
116 s_bin->max_blocks = max_blocks;
119 s_bin->bin->last_page =
NULL;
120 s_bin->bin->next =
NULL;
121 s_bin->bin->sizeW = sizeW;
122 s_bin->bin->max_blocks = max_blocks;
123 s_bin->bin->sticky = 0;
136 return om_new_specBin;
◆ _omUnGetSpecBin()
void _omUnGetSpecBin |
( |
omBin * |
bin_p, |
|
|
int |
force |
|
) |
| |
Definition at line 138 of file omBin.c.
162 if (s_bin->ref == 0 || force)
168 if(s_bin->bin->last_page ==
NULL || force)
◆ omCreateStickyBin()
static omBin omCreateStickyBin |
( |
omBin |
bin, |
|
|
unsigned long |
sticky |
|
) |
| |
|
static |
Definition at line 191 of file omBin.c.
197 s_bin->sticky = sticky;
199 s_bin->last_page =
NULL;
200 s_bin->max_blocks = bin->max_blocks;
201 s_bin->sizeW = bin->sizeW;
202 s_bin->next = bin->next;
◆ omDeleteStickyAllBinTag()
void omDeleteStickyAllBinTag |
( |
unsigned long |
sticky | ) |
|
◆ omDeleteStickyBinTag()
void omDeleteStickyBinTag |
( |
omBin |
bin, |
|
|
unsigned long |
sticky |
|
) |
| |
Definition at line 334 of file omBin.c.
349 if (sticky_bin !=
NULL)
352 omAssume(no_sticky_bin !=
NULL && sticky_bin != no_sticky_bin);
356 if (bin == sticky_bin)
358 sticky_bin = no_sticky_bin;
◆ omGetBinStat()
static void omGetBinStat |
( |
omBin |
bin, |
|
|
long * |
pages_p, |
|
|
long * |
used_blocks_p, |
|
|
long * |
free_blocks_p |
|
) |
| |
|
static |
Definition at line 603 of file omBin.c.
612 long pages = 0, used_blocks = 0, free_blocks = 0;
618 pages++;
if (where == 1)
621 if (bin->max_blocks > 0)
626 if (bin->max_blocks > 1)
627 used_blocks += bin->max_blocks;
631 if (page == bin->current_page) where = -1;
◆ omGetMaxStickyBinTag()
unsigned long omGetMaxStickyBinTag |
( |
omBin |
bin | ) |
|
Definition at line 204 of file omBin.c.
209 unsigned long sticky = 0;
212 if (bin->sticky > sticky) sticky = bin->sticky;
◆ omGetNewStickyAllBinTag()
unsigned long omGetNewStickyAllBinTag |
( |
| ) |
|
Definition at line 479 of file omBin.c.
486 unsigned long sticky = 0, new_sticky;
493 if (new_sticky > sticky) sticky = new_sticky;
496 while (s_bin !=
NULL)
499 if (new_sticky > sticky) sticky = new_sticky;
510 while (s_bin !=
NULL)
528 while (s_bin !=
NULL)
◆ omGetNewStickyBinTag()
unsigned long omGetNewStickyBinTag |
( |
omBin |
bin | ) |
|
◆ omGetStickyBinOfBin()
Definition at line 369 of file omBin.c.
377 new_bin->sticky = SIZEOF_VOIDP;
378 new_bin->max_blocks = bin->max_blocks;
379 new_bin->sizeW = bin->sizeW;
382 new_bin->last_page =
NULL;
◆ omGetTotalBinStat()
static void omGetTotalBinStat |
( |
omBin |
bin, |
|
|
long * |
pages_p, |
|
|
long * |
used_blocks_p, |
|
|
long * |
free_blocks_p |
|
) |
| |
|
static |
Definition at line 633 of file omBin.c.
642 long t_pages = 0, t_used_blocks = 0, t_free_blocks = 0;
643 long pages = 0, used_blocks = 0, free_blocks = 0;
649 t_used_blocks += used_blocks;
650 t_free_blocks += free_blocks;
◆ omGetUsedBinBytes()
long omGetUsedBinBytes |
( |
| ) |
|
Definition at line 755 of file omBin.c.
756 long pages = 0, used_blocks = 0, free_blocks = 0;
758 return (used_blocks)*((long)bin->sizeW)*SIZEOF_LONG;
772 while (s_bin !=
NULL)
782 s_bin = om_SpecTrackBin;
783 while (s_bin !=
NULL)
791 while (sticky !=
NULL)
◆ omGetUsedBytesOfBin()
static long omGetUsedBytesOfBin |
( |
omBin |
bin | ) |
|
|
static |
◆ omIsKnownTopBin()
int omIsKnownTopBin |
( |
omBin |
bin, |
|
|
int |
normal_bin |
|
) |
| |
Definition at line 435 of file omBin.c.
446 omAssume(normal_bin == 1 || normal_bin == 0);
451 to_check = om_StaticTrackBin;
452 s_bin = om_SpecTrackBin;
464 if (bin == &(to_check[
i]))
468 while (s_bin !=
NULL)
470 if (bin == s_bin->bin)
return 1;
475 while (to_check !=
NULL)
◆ omMergeStickyBinIntoBin()
void omMergeStickyBinIntoBin |
( |
omBin |
sticky_bin, |
|
|
omBin |
into_bin |
|
) |
| |
Definition at line 392 of file omBin.c.
399 !sticky_bin->sticky ||
400 sticky_bin->max_blocks != into_bin->max_blocks ||
401 sticky_bin == into_bin ||
408 (!sticky_bin->sticky ?
"sticky_bin is not sticky" :
409 (sticky_bin->max_blocks != into_bin->max_blocks ?
"sticky_bin and into_bin have different block sizes" :
410 (sticky_bin == into_bin ?
"sticky_bin == into_bin" :
413 "unknown sticky_bin error")))))));
424 omBin _ibin = into_bin;
◆ omMergeStickyPages()
static void omMergeStickyPages |
( |
omBin |
to_bin, |
|
|
omBin |
from_bin |
|
) |
| |
|
static |
Definition at line 262 of file omBin.c.
267 #ifdef HAVE_OM_ASSUME
273 omAssume(to_bin->sizeW == from_bin->sizeW);
276 if (page ==
NULL)
return;
280 if (page->prev ==
NULL)
break;
285 if (to_bin->last_page ==
NULL)
288 to_bin->last_page = from_bin->last_page;
289 to_bin->current_page = from_bin->current_page;
294 to_bin->current_page !=
NULL);
296 if (to_bin->current_page->current !=
NULL)
298 if (to_bin->current_page->prev ==
NULL)
300 from_bin->last_page->next = to_bin->current_page;
301 to_bin->current_page->prev = from_bin->last_page;
302 to_bin->current_page = from_bin->current_page;
305 to_bin->current_page = to_bin->current_page->prev;
312 to_bin->current_page->used_blocks = 0;
317 to_bin->current_page->current ==
NULL &&
318 to_bin->current_page->used_blocks == 0);
320 from_bin->last_page->next = to_bin->current_page->next;
321 if (to_bin->current_page->next !=
NULL)
322 to_bin->current_page->next->prev = from_bin->last_page;
325 omAssume(to_bin->current_page == to_bin->last_page);
326 to_bin->last_page = from_bin->last_page;
328 to_bin->current_page->next = page;
329 page->prev = to_bin->current_page;
330 to_bin->current_page = from_bin->current_page;
332 #ifdef HAVE_OM_ASSUME
◆ omPrintBinStat()
static void omPrintBinStat |
( |
FILE * |
fd, |
|
|
omBin |
bin, |
|
|
int |
track, |
|
|
long * |
pages, |
|
|
long * |
used_blocks, |
|
|
long * |
free_blocks |
|
) |
| |
|
static |
Definition at line 655 of file omBin.c.
672 (
long)bin->sizeW, bin->max_blocks);
675 fprintf(
fd,
"%ld\t%ld\t%ld\n", *pages, *free_blocks, *used_blocks);
678 long s_pages, s_free_blocks, s_used_blocks;
681 omGetBinStat(bin, &s_pages, &s_used_blocks, &s_free_blocks);
682 fprintf(
fd,
" \t \t%ld\t%ld\t%ld\t%d\n", s_pages, s_free_blocks, s_used_blocks,
◆ omPrintBinStats()
void omPrintBinStats |
( |
FILE * |
fd | ) |
|
Definition at line 686 of file omBin.c.
695 long pages=0, used_blocks=0, free_blocks=0;
696 long pages_p, used_blocks_p, free_blocks_p;
700 fputs(
" SizeW\tBlocks\tUPages\tFBlocks\tUBlocks\tSticky\n",
fd);
702 while (s_bin !=
NULL ||
i >= 0)
704 if (s_bin ==
NULL || (
i >= 0 && (
unsigned long)
om_StaticBin[
i].max_blocks < (
unsigned long) s_bin->bin->max_blocks))
708 used_blocks += used_blocks_p;
709 free_blocks += free_blocks_p;
713 omPrintBinStat(
fd, &om_StaticTrackBin[
i], 1, &pages_p, &used_blocks_p, &free_blocks_p);
715 used_blocks += used_blocks_p;
716 free_blocks += free_blocks_p;
725 used_blocks += used_blocks_p;
726 free_blocks += free_blocks_p;
731 s_bin = om_SpecTrackBin;
732 while (s_bin !=
NULL)
734 omPrintBinStat(
fd, s_bin->bin, 0, &pages_p, &used_blocks_p, &free_blocks_p);
737 used_blocks += used_blocks_p;
738 free_blocks += free_blocks_p;
742 while (sticky !=
NULL)
745 sticky = sticky->next;
◆ omSetStickyAllBinTag()
void omSetStickyAllBinTag |
( |
unsigned long |
sticky | ) |
|
◆ omSetStickyBinTag()
void omSetStickyBinTag |
( |
omBin |
bin, |
|
|
unsigned long |
sticky_tag |
|
) |
| |
Definition at line 232 of file omBin.c.
248 tc = bin->current_page;
249 bin->sticky = s_bin->sticky;
250 bin->current_page = s_bin->current_page;
251 bin->last_page = s_bin->last_page;
253 s_bin->last_page = tl;
◆ omUnSetStickyAllBinTag()
void omUnSetStickyAllBinTag |
( |
unsigned long |
sticky | ) |
|
◆ omUnSetStickyBinTag()
void omUnSetStickyBinTag |
( |
omBin |
bin, |
|
|
unsigned long |
sticky |
|
) |
| |
◆ om_StickyBins
void omFreeKeptAddrFromBin(omBin bin)
void omDeleteStickyBinTag(omBin bin, unsigned long sticky)
#define omSetTopBinAndStickyOfPage(page, bin, sticky)
static void omPrintBinStat(FILE *fd, omBin bin, int track, long *pages, long *used_blocks, long *free_blocks)
#define omIsOnGList(ptr, next, addr)
#define omIsStaticBin(bin)
omError_t omReportError(omError_t error, omError_t report_error, OM_FLR_DECL, const char *fmt,...)
static BOOLEAN length(leftv result, leftv arg)
#define omRemoveFromGList(ptr, next, addr)
#define omSmallSize2AlignedBin
#define omGetUsedBlocksOfPage(page)
static void omMergeStickyPages(omBin to_bin, omBin from_bin)
#define omInsertInSortedGList(ptr, next, what, addr)
#define omGetStickyBin(bin, sticky_tag)
#define OM_MAX_BLOCK_SIZE
#define omFindInSortedGList(ptr, next, what, value)
#define omFreeSize(addr, size)
static long omGetUsedBytesOfBin(omBin bin)
static void omGetBinStat(omBin bin, long *pages_p, long *used_blocks_p, long *free_blocks_p)
#define omGListLength(ptr, next)
#define omSmallSize2Bin(size)
#define OM_SIZEOF_UNIQUE_MAX_BLOCK_THRESHOLD
unsigned long omGetMaxStickyBinTag(omBin bin)
omBinPage_t om_ZeroPage[]
#define omUnGetSpecBin(bin_ptr)
#define omIsStaticNormalBin(bin)
#define SIZEOF_OM_BIN_PAGE
#define omRemoveFromSortedGList(ptr, next, what, addr)
#define omIsTrackBin(bin)
#define omFindInGList(ptr, next, what, value)
void omSetStickyBinTag(omBin bin, unsigned long sticky_tag)
static omBin omCreateStickyBin(omBin bin, unsigned long sticky)
int omIsKnownTopBin(omBin bin, int normal_bin)
static void omGetTotalBinStat(omBin bin, long *pages_p, long *used_blocks_p, long *free_blocks_p)
void omUnSetStickyBinTag(omBin bin, unsigned long sticky)
#define omIsStickyBin(bin)