Skip to content

mem_alloc

Declaration

mem_alloc :: fn (size: usize) *u8

Description

Allocates count of bytes on heap using default allocator. Use mem_free to free allocated memory when it's no longer needed. Cause panic when allocation is not possible. This function use allocator set in _context.alloc_fn

Arguments

  • size Bytes to be allocated.

Result

Pointer to begin of the new allocated block of memory.

Declared in: memory.bl