#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 119 of file om_Alloc.c.
131 bin->current_page->used_blocks &= (((
unsigned long) 1) << (
BIT_SIZEOF_LONG -1));
133 bin->current_page->used_blocks = 0;
137 if (!bin->sticky && bin->current_page->next !=
NULL)
140 newpage = bin->current_page->next;
149 bin->current_page = newpage;
151 newpage->current !=
NULL);
#define __omTypeAllocFromNonEmptyPage(type, addr, page)
omBinPage_t om_ZeroPage[]
OM_INLINE_LOCAL void omInsertBinPage(omBinPage after, omBinPage page, omBin bin)
static omBinPage omAllocNewBinPage(omBin bin)
◆ omAllocNewBinPage()
Definition at line 32 of file om_Alloc.c.
44 newpage->used_blocks = -1;
46 tmp = newpage->current;
47 while (i < bin->max_blocks)
49 tmp = *((
void**)tmp) = ((
void**) tmp) + bin->sizeW;
52 *((
void**)tmp) =
NULL;
54 (bin->max_blocks > 1 ? bin->max_blocks : 1));
#define omSetTopBinAndStickyOfPage(page, bin, sticky)
#define SIZEOF_OM_BIN_PAGE_HEADER
omBinPage omAllocBinPages(int how_many)
omBinPage omAllocBinPage()
#define omIsAddrPageAligned(addr)
#define omListLength(ptr)
◆ omDoRealloc()
void* omDoRealloc |
( |
void * |
old_addr, |
|
|
size_t |
new_size, |
|
|
int |
flag |
|
) |
| |
Definition at line 229 of file om_Alloc.c.
247 #ifdef OM_ALIGNMENT_NEEDS_WORK
255 min_size = (old_size < new_size ? old_size : new_size);
256 omMemcpyW(new_addr, old_addr, min_size >> LOG_SIZEOF_LONG);
258 if (
DO_ZERO(flag) && (new_size > old_size))
259 omMemsetW((
char*) new_addr + min_size, 0, (new_size - old_size) >> LOG_SIZEOF_LONG);
#define __omTypeAlloc(type, addr, size)
#define __omTypeAllocAligned
#define __omFreeSize(addr, size)
void * omRealloc0Large(void *old_addr, size_t new_size)
size_t omSizeOfAddr(const void *addr)
void * omReallocLarge(void *old_addr, size_t new_size)
#define omIsBinPageAddr(addr)
#define omMemcpyW(p1, p2, l)
#define omMemsetW(P1, W, L)
#define OM_MAX_BLOCK_SIZE
◆ omFreeToPageFault()
void omFreeToPageFault |
( |
omBinPage |
page, |
|
|
void * |
addr |
|
) |
| |
Definition at line 167 of file om_Alloc.c.
173 if (page->used_blocks < 0L)
175 omFreeTrackAddr(addr);
181 if ((page->current !=
NULL) || (bin->max_blocks <= 1))
186 if (bin->max_blocks > 0)
191 om_JustFreedPage = page;
197 page->current = addr;
198 page->used_blocks = bin->max_blocks - 2;
199 *((
void**)addr) =
NULL;
202 #if defined(PAGE_BEFORE_CURRENT)
203 if (bin->current_page->prev !=
NULL)
207 bin->current_page = page;
209 # if defined(PAGE_AFTER_CURRENT)
void omFreeBinPages(omBinPage bin_page, int how_many)
#define omFreeBinPage(addr)
OM_INLINE_DECL omBin omGetBinOfPage(omBinPage page)
OM_INLINE_LOCAL void omTakeOutBinPage(omBinPage page, omBin bin)
◆ omInsertBinPage()
Definition at line 90 of file om_Alloc.c.
97 bin->current_page = page;
98 bin->last_page = page;
103 if (after == bin->last_page)
105 bin->last_page = page;
110 after->next->prev = page;
112 page->next = after->next;
◆ omTakeOutBinPage()
Definition at line 59 of file om_Alloc.c.
61 if (bin->current_page == page)
63 if (page->next ==
NULL)
65 if (page->prev ==
NULL)
68 bin->last_page =
NULL;
72 bin->current_page = page->prev;
75 bin->current_page = page->next;
77 if (bin->last_page == page)
80 bin->last_page = page->prev;
85 page->next->prev = page->prev;
87 if (page->prev !=
NULL) page->prev->next = page->next;
◆ om_SpecBin
◆ om_ZeroPage