void ctr_rend_texture_init() { void *mem = linearMemAlign(MEM_SPACE_SIZE, 0x80); tex_msp = create_mspace_with_base(mem, MEM_SPACE_SIZE, 0); mspace_track_large_chunks(tex_msp, 1); tex_msp_base = mem; }
int palHeapAllocator::Create(palPageAllocator* page_allocator) { internal_ = create_mspace(0, page_allocator); if (internal_ == NULL) { return PAL_HEAP_ALLOCATOR_COULD_NOT_CREATE; } mspace_track_large_chunks(internal_, 1); return 0; }
void MemoryHeap::initialize() { mMspace = create_mspace_with_granularity(mPageSize, 0, this); mspace_track_large_chunks(mMspace, 1); lassert(mPageSize == mspace_footprint(mMspace)); }
void new_default_arena_with_capacity(memory_arena *arena, ulen starting_capacity) { mspace space = create_mspace(starting_capacity, 0); // TODO: Should locked be 1 instead? That would help with threadsafety. if (space == NULL) { panic("OOM while building new dlmalloc mspace"); } mspace_track_large_chunks(space, 1); // make sure that destroying an arena will always free all its memory new_custom_arena(arena, space); arena->alloc = mspace_malloc; arena->alloc_zeroed = dlmalloc_mspace_alloc_zeroed; arena->free = mspace_free; arena->realloc = mspace_realloc; arena->deallocate = dlmalloc_mspace_deallocate; }