[umalloc] Remove userptr_t from user memory allocations

Use standard void pointers for umalloc(), urealloc(), and ufree(),
with the "u" prefix retained to indicate that these allocations are
made from external ("user") memory rather than from the internal heap.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-04-23 12:47:53 +01:00
parent 0bf0f8716a
commit 839540cb95
13 changed files with 101 additions and 151 deletions
-17
View File
@@ -71,23 +71,6 @@ struct autosized_block {
char data[0];
};
/**
* Address for zero-length memory blocks
*
* @c malloc(0) or @c realloc(ptr,0) will return the special value @c
* NOWHERE. Calling @c free(NOWHERE) will have no effect.
*
* This is consistent with the ANSI C standards, which state that
* "either NULL or a pointer suitable to be passed to free()" must be
* returned in these cases. Using a special non-NULL value means that
* the caller can take a NULL return value to indicate failure,
* without first having to check for a requested size of zero.
*
* Code outside of malloc.c do not ever need to refer to the actual
* value of @c NOWHERE; this is an internal definition.
*/
#define NOWHERE ( ( void * ) ~( ( intptr_t ) 0 ) )
/** List of free memory blocks */
static LIST_HEAD ( free_blocks );