 |
My Project
debian-1:4.1.1-p2+ds-4build1
|
#include "omalloc.h"
#include "omalloc/omTables.inc"
Go to the source code of this file.
◆ DO_ZERO
#define DO_ZERO |
( |
|
flag | ) |
flag |
◆ OM_ALLOC_C
◆ omAllocBinFromFullPage()
void* omAllocBinFromFullPage |
( |
omBin |
bin | ) |
|
Definition at line 116 of file om_Alloc.c.
129 bin->current_page->used_blocks &= (((
unsigned long) 1) << (
BIT_SIZEOF_LONG -1));
131 bin->current_page->used_blocks = 0;
135 if (!bin->sticky && bin->current_page->next !=
NULL)
138 newpage = bin->current_page->next;
147 bin->current_page = newpage;
149 newpage->current !=
NULL);
◆ omAllocNewBinPage()
Definition at line 29 of file om_Alloc.c.
42 newpage->used_blocks = -1;
44 tmp = newpage->current;
45 while (i < bin->max_blocks)
47 tmp = *((
void**)tmp) = ((
void**) tmp) + bin->sizeW;
50 *((
void**)tmp) =
NULL;
52 (bin->max_blocks > 1 ? bin->max_blocks : 1));
◆ omDoRealloc()
void* omDoRealloc |
( |
void * |
old_addr, |
|
|
size_t |
new_size, |
|
|
int |
flag |
|
) |
| |
Definition at line 225 of file om_Alloc.c.
245 #ifdef OM_ALIGNMENT_NEEDS_WORK
253 min_size = (old_size < new_size ? old_size : new_size);
254 omMemcpyW(new_addr, old_addr, min_size >> LOG_SIZEOF_LONG);
256 if (
DO_ZERO(flag) && (new_size > old_size))
257 omMemsetW((
char*) new_addr + min_size, 0, (new_size - old_size) >> LOG_SIZEOF_LONG);
◆ omFreeToPageFault()
void omFreeToPageFault |
( |
omBinPage |
page, |
|
|
void * |
addr |
|
) |
| |
Definition at line 164 of file om_Alloc.c.
171 if (page->used_blocks < 0L)
173 omFreeTrackAddr(addr);
179 if ((page->current !=
NULL) || (bin->max_blocks <= 1))
184 if (bin->max_blocks > 0)
189 om_JustFreedPage = page;
195 page->current = addr;
196 page->used_blocks = bin->max_blocks - 2;
197 *((
void**)addr) =
NULL;
200 #if defined(PAGE_BEFORE_CURRENT)
201 if (bin->current_page->prev !=
NULL)
205 bin->current_page = page;
207 # if defined(PAGE_AFTER_CURRENT)
◆ omInsertBinPage()
Definition at line 87 of file om_Alloc.c.
95 bin->current_page = page;
96 bin->last_page = page;
101 if (after == bin->last_page)
103 bin->last_page = page;
108 after->next->prev = page;
110 page->next = after->next;
◆ omTakeOutBinPage()
Definition at line 56 of file om_Alloc.c.
59 if (bin->current_page == page)
61 if (page->next ==
NULL)
63 if (page->prev ==
NULL)
66 bin->last_page =
NULL;
70 bin->current_page = page->prev;
73 bin->current_page = page->next;
75 if (bin->last_page == page)
78 bin->last_page = page->prev;
83 page->next->prev = page->prev;
85 if (page->prev !=
NULL) page->prev->next = page->next;
◆ om_SpecBin
◆ om_ZeroPage
#define omMemsetW(P1, W, L)
#define omFreeBinPage(addr)
size_t omSizeOfAddr(const void *addr)
#define omSetTopBinAndStickyOfPage(page, bin, sticky)
#define __omTypeAllocAligned
#define __omFreeSize(addr, size)
omBinPage omAllocBinPage()
OM_INLINE_LOCAL void omTakeOutBinPage(omBinPage page, omBin bin)
void omFreeBinPages(omBinPage bin_page, int how_many)
#define __omTypeAlloc(type, addr, size)
#define omIsBinPageAddr(addr)
#define OM_MAX_BLOCK_SIZE
OM_INLINE_DECL omBin omGetBinOfPage(omBinPage page)
#define omMemcpyW(p1, p2, l)
#define SIZEOF_OM_BIN_PAGE_HEADER
OM_INLINE_LOCAL void omInsertBinPage(omBinPage after, omBinPage page, omBin bin)
#define __omTypeAllocFromNonEmptyPage(type, addr, page)
void * omReallocLarge(void *old_addr, size_t new_size)
void * omRealloc0Large(void *old_addr, size_t new_size)
static omBinPage omAllocNewBinPage(omBin bin)
omBinPage_t om_ZeroPage[]
omBinPage omAllocBinPages(int how_many)
#define omListLength(ptr)
#define omIsAddrPageAligned(addr)