libmemalloc  v4.0.00
Modern Memory Allocator
Loading...
Searching...
No Matches
mem_allocator_t Struct Reference

Manages dynamic memory allocation. More...

#include <libmemalloc.h>

Collaboration diagram for mem_allocator_t:

Public Attributes

uint8_t * heap_start
 
uint8_t * heap_end
 
size_t metadata_size
 
uintptr_t * stack_top
 
uintptr_t * stack_bottom
 
size_t num_size_classes
 
size_t num_arenas
 
block_header_tlast_allocated
 
block_header_t ** free_lists
 
mem_arena_tarenas
 
mmap_tmmap_list
 
gc_thread_t gc_thread
 

Detailed Description

Manages dynamic memory allocation.

This structure manages the heap, including free lists for memory blocks, garbage collection, and allocation strategies.

Fields:
  • heap_start – Base of the user heap region
  • heap_end – Current end of the heap
  • metadata_size – Bytes reserved for bins and arenas
  • stack_top – Upper bound of application stack
  • stack_bottom – Lower bound of application stack
  • last_allocated – Last block returned (NEXT_FIT)
  • num_size_classes – Total size classes available
  • num_arenas – Number of arena partitions
  • arenas – Array of arena metadata
  • mmap_list – Linked list of mmap’d regions
  • free_lists – Segregated free lists by size class
  • gc_thread – Garbage collector controller

Member Data Documentation

◆ arenas

mem_arena_t* mem_allocator_t::arenas

Array of arena metadata

◆ free_lists

block_header_t** mem_allocator_t::free_lists

Segregated free lists by size class

◆ gc_thread

gc_thread_t mem_allocator_t::gc_thread

Garbage collector controller

◆ heap_end

uint8_t* mem_allocator_t::heap_end

Current end of the heap

◆ heap_start

uint8_t* mem_allocator_t::heap_start

Base of the user heap region

◆ last_allocated

block_header_t* mem_allocator_t::last_allocated

Last block returned (NEXT_FIT)

◆ metadata_size

size_t mem_allocator_t::metadata_size

Bytes reserved for bins and arenas

◆ mmap_list

mmap_t* mem_allocator_t::mmap_list

Linked list of mmap’d regions

◆ num_arenas

size_t mem_allocator_t::num_arenas

Number of arena partitions

◆ num_size_classes

size_t mem_allocator_t::num_size_classes

Total size classes available

◆ stack_bottom

uintptr_t* mem_allocator_t::stack_bottom

Lower bound of application stack

◆ stack_top

uintptr_t* mem_allocator_t::stack_top

Upper bound of application stack


The documentation for this struct was generated from the following file: