|
iPXE
|
User memory allocation. More...
#include <stddef.h>#include <ipxe/api.h>#include <ipxe/malloc.h>#include <config/umalloc.h>#include <ipxe/uheap.h>#include <ipxe/efi/efi_umalloc.h>#include <ipxe/linux/linux_umalloc.h>#include <bits/umalloc.h>Go to the source code of this file.
Macros | |
| #define | PROVIDE_UMALLOC(_subsys, _api_func, _func) PROVIDE_SINGLE_API ( UMALLOC_PREFIX_ ## _subsys, _api_func, _func ) |
| Provide a user memory allocation API implementation. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| void * | urealloc (void *ptr, size_t new_size) |
| Reallocate external memory. More... | |
| static __always_inline void * | umalloc (size_t size) |
| Allocate external memory. More... | |
| static __always_inline void | ufree (void *ptr) |
| Free external memory. More... | |
User memory allocation.
Definition in file umalloc.h.
| #define PROVIDE_UMALLOC | ( | _subsys, | |
| _api_func, | |||
| _func | |||
| ) | PROVIDE_SINGLE_API ( UMALLOC_PREFIX_ ## _subsys, _api_func, _func ) |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| void* urealloc | ( | void * | ptr, |
| size_t | new_size | ||
| ) |
Reallocate external memory.
| old_ptr | Memory previously allocated by umalloc(), or NULL |
| new_size | Requested size |
| new_ptr | Allocated memory, or NULL |
Calling realloc() with a new size of zero is a valid way to free a memory block.
Referenced by fdt_urealloc(), image_set_len(), ufree(), umalloc(), and xferbuf_umalloc_realloc().
|
inlinestatic |
Allocate external memory.
| size | Requested size |
| ptr | Memory, or NULL |
Memory is guaranteed to be aligned to a page boundary.
Definition at line 56 of file umalloc.h.
References NULL, size, and urealloc().
Referenced by alloc_pixbuf(), arbel_alloc_icm(), arbel_start_firmware(), efifb_glyphs(), exanic_probe_port(), fbcon_init(), fbcon_picture_init(), fdt_create(), golan_provide_pages(), hermon_map_icm(), hermon_start_firmware(), netvsc_create_buffer(), nii_initialise_flags(), png_image_header(), txnic_alloc(), and ucode_update_all().
|
inlinestatic |
Free external memory.
| ptr | Memory allocated by umalloc(), or NULL |
If ptr is NULL, no action is taken.
Definition at line 67 of file umalloc.h.
References urealloc().
Referenced by arbel_free(), efifb_fini(), efifb_glyphs(), efifb_init(), exanic_probe_port(), exanic_remove_port(), fbcon_fini(), fbcon_init(), fbcon_picture_init(), fdt_create(), fdt_remove(), free_image(), free_pixbuf(), golan_free_fw_areas(), hermon_free(), netvsc_create_buffer(), netvsc_destroy_buffer(), nii_initialise_flags(), nii_shutdown(), png_pixbuf(), txnic_alloc(), txnic_free(), and ucode_update_all().
1.8.15