NCBI C++ ToolKit
|
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
struct | SHEAP_HeapBlock |
struct | SHEAP_tag |
Macros | |
#define | NCBI_USE_ERRCODE_X Connect_HeapMgr |
#define | abs(a) ((a) < 0 ? (a) : -(a)) |
#define | HEAP_PACKED /* */ |
#define | _HEAP_ALIGN_EX(a, b) ((((unsigned long)(a) + ((b) - 1)) / (b)) * (b)) |
#define | _HEAP_ALIGN_2(a, b) |
#define | _HEAP_SIZESHIFT 4 |
#define | HEAP_BLOCKS(s) ((s) >> _HEAP_SIZESHIFT) |
#define | HEAP_EXTENT(b) ((b) << _HEAP_SIZESHIFT) |
#define | HEAP_ALIGN(a) _HEAP_ALIGN_2(a, HEAP_EXTENT(1)) |
#define | HEAP_MASK (~(HEAP_EXTENT(1) - 1)) |
#define | HEAP_PREV_BIT 8 |
#define | HEAP_NEXT_BIT 4 |
#define | HEAP_LAST 2 |
#define | HEAP_USED 1 |
#define | HEAP_SIZE(s) ((s) & (unsigned long) HEAP_MASK) |
#define | HEAP_FLAG(s) ((s) & (unsigned long)(~HEAP_MASK)) |
#define | HEAP_NEXT(b) |
#define | HEAP_PREV(b) |
#define | HEAP_INDEX(b, base) ((TNCBI_Size)((b) - (base))) |
#define | HEAP_ISLAST(b) ((b)->head.flag & HEAP_LAST) |
#define | HEAP_ISUSED(b) ((b)->head.flag & HEAP_USED) |
#define | HEAP_CHECK(heap) |
#define | s_HEAP_Unlink(b) { b->prevfree = b->nextfree = ~((TNCBI_Size) 0); } |
Variables | |
static int | s_HEAP_fast = 1 |
Definition at line 175 of file ncbi_heapmgr.c.
Definition at line 174 of file ncbi_heapmgr.c.
#define _HEAP_SIZESHIFT 4 |
Definition at line 177 of file ncbi_heapmgr.c.
#define HEAP_ALIGN | ( | a | ) | _HEAP_ALIGN_2(a, HEAP_EXTENT(1)) |
Definition at line 180 of file ncbi_heapmgr.c.
#define HEAP_BLOCKS | ( | s | ) | ((s) >> _HEAP_SIZESHIFT) |
Definition at line 178 of file ncbi_heapmgr.c.
#define HEAP_CHECK | ( | heap | ) |
Definition at line 196 of file ncbi_heapmgr.c.
#define HEAP_EXTENT | ( | b | ) | ((b) << _HEAP_SIZESHIFT) |
Definition at line 179 of file ncbi_heapmgr.c.
#define HEAP_FLAG | ( | s | ) | ((s) & (unsigned long)(~HEAP_MASK)) |
Definition at line 187 of file ncbi_heapmgr.c.
#define HEAP_INDEX | ( | b, | |
base | |||
) | ((TNCBI_Size)((b) - (base))) |
Definition at line 192 of file ncbi_heapmgr.c.
Definition at line 193 of file ncbi_heapmgr.c.
Definition at line 194 of file ncbi_heapmgr.c.
#define HEAP_LAST 2 |
Definition at line 184 of file ncbi_heapmgr.c.
#define HEAP_MASK (~(HEAP_EXTENT(1) - 1)) |
Definition at line 181 of file ncbi_heapmgr.c.
#define HEAP_NEXT | ( | b | ) |
Definition at line 188 of file ncbi_heapmgr.c.
#define HEAP_NEXT_BIT 4 |
Definition at line 183 of file ncbi_heapmgr.c.
#define HEAP_PACKED /* */ |
Definition at line 145 of file ncbi_heapmgr.c.
#define HEAP_PREV | ( | b | ) |
Definition at line 190 of file ncbi_heapmgr.c.
#define HEAP_PREV_BIT 8 |
Definition at line 182 of file ncbi_heapmgr.c.
#define HEAP_SIZE | ( | s | ) | ((s) & (unsigned long) HEAP_MASK) |
Definition at line 186 of file ncbi_heapmgr.c.
#define HEAP_USED 1 |
Definition at line 185 of file ncbi_heapmgr.c.
#define NCBI_USE_ERRCODE_X Connect_HeapMgr |
Definition at line 120 of file ncbi_heapmgr.c.
#define s_HEAP_Unlink | ( | b | ) | { b->prevfree = b->nextfree = ~((TNCBI_Size) 0); } |
Definition at line 499 of file ncbi_heapmgr.c.
|
static |
Definition at line 513 of file ncbi_heapmgr.c.
References assert, b, f(), free(), heap, HEAP_BLOCKS, HEAP_EXTENT, HEAP_INDEX, HEAP_ISLAST, HEAP_ISUSED, HEAP_LAST, HEAP_NEXT, HEAP_SIZE, int, last(), memmove, n, s_HEAP_Link(), s_HEAP_Unlink, and ncbi::grid::netcache::search::fields::size.
Referenced by HEAP_Alloc(), and HEAP_Trim().
|
static |
Definition at line 399 of file ncbi_heapmgr.c.
References assert, b, CORE_LOGF_X, eLOG_Error, f(), SHEAP_HeapBlock::head, head, heap, HEAP_INDEX, HEAP_ISUSED, msg(), SHEAP_HeapBlock::nextfree, s_HEAP_fast, s_HEAP_Id(), SHEAP_Block::size, and unlikely.
Referenced by HEAP_Alloc(), and s_HEAP_Link().
|
static |
Definition at line 754 of file ncbi_heapmgr.c.
References assert, b, SHEAP_Block::flag, SHEAP_HeapBlock::head, heap, HEAP_BLOCKS, HEAP_INDEX, HEAP_ISLAST, HEAP_ISUSED, HEAP_LAST, HEAP_NEXT, last(), n, SHEAP_HeapBlock::nextfree, SHEAP_HeapBlock::prevfree, s_HEAP_Link(), s_HEAP_Unlink, and SHEAP_Block::size.
Referenced by HEAP_Free(), and HEAP_FreeFast().
Definition at line 378 of file ncbi_heapmgr.c.
References abs, buf, SHEAP_tag::refcnt, and SHEAP_tag::serial.
Referenced by HEAP_Alloc(), HEAP_Destroy(), HEAP_Free(), HEAP_FreeFast(), HEAP_Trim(), s_HEAP_Find(), and x_HEAP_Walk().
|
static |
Definition at line 460 of file ncbi_heapmgr.c.
References assert, b, f(), free(), SHEAP_HeapBlock::head, heap, HEAP_INDEX, HEAP_ISUSED, s_HEAP_Find(), and SHEAP_Block::size.
Referenced by HEAP_Trim(), s_HEAP_Collect(), s_HEAP_Free(), and s_HEAP_Take().
|
static |
Definition at line 599 of file ncbi_heapmgr.c.
References assert, b, f(), head, heap, HEAP_BLOCKS, HEAP_EXTENT, HEAP_INDEX, HEAP_ISLAST, HEAP_ISUSED, HEAP_LAST, HEAP_NEXT, HEAP_SIZE, HEAP_USED, int, last(), n, s_HEAP_Link(), s_HEAP_Unlink, and ncbi::grid::netcache::search::fields::size.
Referenced by HEAP_Alloc().
|
static |
Definition at line 1203 of file ncbi_heapmgr.c.
References assert, b, head, heap, HEAP_ISLAST, HEAP_NEXT, likely, s_HEAP_fast, unlikely, and x_HEAP_Walk().
Referenced by HEAP_Next(), and HEAP_Walk().
|
static |
Definition at line 1013 of file ncbi_heapmgr.c.
References b, CORE_LOGF_X, eLOG_Error, SHEAP_HeapBlock::head, heap, HEAP_ALIGN, HEAP_INDEX, HEAP_ISLAST, HEAP_ISUSED, HEAP_NEXT, i, l(), msg(), n, SHEAP_HeapBlock::nextfree, ok, SHEAP_HeapBlock::prevfree, s_HEAP_Id(), and SHEAP_Block::size.
Referenced by s_HEAP_Walk().
|
static |
Definition at line 171 of file ncbi_heapmgr.c.
Referenced by HEAP_FreeFast(), HEAP_Options(), HEAP_Trim(), s_HEAP_Find(), and s_HEAP_Walk().