Previous: libefi-argp, Up: libefi
Besides the functions that the uefi makes available for memory management, the `efi' library provides a set of convenience functions to make it easier to allocate and free memory.
To allocate pooled memory the efi_malloc
function can be used.
The difference from efi_allocate_pool
is that efi_malloc
returns a pointer to the allocated memory. Memory allocated with
efi_malloc
is like any other pooled memory freed with
efi_free_pool
.
Allocate size bytes of pooled memory from memory pool specified by type. Return pointer to allocated memory, or
NULL
if memory could not be allocated.
The efi_palloc
and efi_pfree
functions operate on
page memory, meaning that the handle non-pooled memory.
efi_palloc
allocates memory and sets it to a specified memory
type, using the given allocation scheme. efi_pfree
releases
memory allocated with either efi_palloc
or
efi_allocate_pages
.