lmemorymanager¶
Compatibility shim that re-exports the memory.heap API under the legacy unit name.
Overview¶
The Wasuro WASM VM project references the old unit name lmemorymanager for heap memory operations. Because the Wasuro source tree cannot be modified, this shim unit re-exports every public symbol from memory.heap so that uses lmemorymanager continues to compile without changes. All functions are thin inline wrappers that delegate directly to their memory.heap counterparts.
Dependencies¶
memory.heap-- the canonical heap allocator implementation in the Asuro kernel.
Constants¶
ALLOC_UNIT¶
Re-exported from memory.heap.ALLOC_UNIT. The base allocation unit size used by the heap allocator.
DATA_OFFSET¶
Re-exported from memory.heap.DATA_OFFSET. Byte offset from a heap block header to the start of user data.
PAGE_SIZE_LMM¶
Re-exported from memory.heap.PAGE_SIZE_LMM. Page size used by the lightweight memory manager.
TOTAL_UNITS¶
Re-exported from memory.heap.TOTAL_UNITS. Total number of allocation units per heap page.
BITMAP_DWORDS¶
Re-exported from memory.heap.BITMAP_DWORDS. Number of 32-bit words in the per-page allocation bitmap.
SIZE_PREFIX¶
Re-exported from memory.heap.SIZE_PREFIX. Size of the prefix stored before each allocation to record its length.
LARGE_ALLOC_MAGIC¶
Re-exported from memory.heap.LARGE_ALLOC_MAGIC. Magic value used to identify large (multi-page) allocations.
Types¶
PHeapPageHeader / THeapPageHeader¶
Re-exported from memory.heap. Pointer and record types describing the header structure at the beginning of each heap page.
Functions and Procedures¶
init¶
Initializes the heap memory manager by delegating tomemory.heap.init.
kalloc¶
Allocatessize bytes from the kernel heap and returns a pointer to the allocated memory.
klalloc¶
Performs a large kernel allocation ofsize bytes and returns a pointer to the allocated memory.
klfree¶
Frees a large allocation previously obtained viaklalloc.
kpalloc¶
Allocates a heap page at the specified address and returns a pointer to it.kfree¶
Frees a standard allocation previously obtained viakalloc.
lmm_total_free¶
Returns the total number of free bytes available across all heap pages.lmm_page_count¶
Returns the current number of heap pages managed by the allocator.Notes¶
- Every function and procedure in the implementation section is marked
inline, so the compiler eliminates the wrapper overhead entirely. - This unit exists solely for backward compatibility with the Wasuro WASM VM build. New kernel code should use
memory.heapdirectly.