static Page_Range *page_range_create() { Page_Range *pr = ofm_malloc_zero(sizeof(Page_Range)); pr->range_root = NULL; pr->range_start = NULL; pr->range_alloc_block = ofm_malloc(APAGE_SIZE); pr->range_alloc_size = APAGE_SIZE; pr->range_alloc_used = 0; return pr; }
static MMU *mmu_create(NewGC *gc) { MMU *mmu = ofm_malloc_zero(sizeof(MMU)); mmu->gc = gc; #if !( defined(_WIN32) || defined(OSKIT) ) #ifdef USE_BLOCK_CACHE mmu->block_cache = block_cache_create(mmu); #else /* initialization of page_range */ mmu->page_range = page_range_create(); /* initialization of alloc_cache */ mmu->alloc_caches[0] = alloc_cache_create(); mmu->alloc_caches[1] = alloc_cache_create(); #endif mmu->os_pagesize = getpagesize(); #else mmu->os_pagesize = APAGE_SIZE; #endif return mmu; }
static AllocCacheBlock *alloc_cache_create() { return ofm_malloc_zero(sizeof(AllocCacheBlock) * BLOCKFREE_CACHE_SIZE); }