[][src]Function solana_bpf_loader_program::helpers::helper_sol_alloc_free

pub fn helper_sol_alloc_free(
    size: u64,
    free_addr: u64,
    _arg3: u64,
    _arg4: u64,
    _arg5: u64,
    context: &mut HelperContext,
    _ro_regions: &[MemoryRegion],
    _rw_regions: &[MemoryRegion]
) -> Result<u64, Error>

Dynamic memory allocation helper called when the BPF program calls sol_alloc_free_(). The allocator is expected to allocate/free from/to a given chunk of memory and enforce size restrictions. The memory chunk is given to the allocator during allocator creation and information about that memory (start address and size) is passed to the VM to use for enforcement.