| BSDMALLOC(3) | Library Functions Manual | BSDMALLOC(3) |
bsdmalloc —
#include <stdlib.h>
void *
malloc(size_t
size);
void *
calloc(size_t
nmemb, size_t
size);
void *
realloc(void
*ptr, size_t
size);
void *
aligned_alloc(size_t
alignment, size_t
size);
int
posix_memalign(void
**memptr, size_t
alignment, size_t
size);
void
free(void
*ptr);
void
_malloc_prefork(void);
void
_malloc_postfork(void);
void
_malloc_postfork_child(void);
bsdmalloc library provides a lower-performance but
smaller-size drop-in replacement for the standard
malloc(3) family of functions
provided by Standard C Library (libc, -lc), as
well as internal hooks for fork(2)
safety in multithreaded programs.
Programs can be statically linked with
-lbsdmalloc for smaller code footprint, at a higher
cost to run-time performance and scalability and limited diagnostics.
bsdmalloc's implementation of
malloc(), calloc(), and
realloc() doesn't correctly set
errno(2) on failure.
| July 4, 2023 | NetBSD 10.2 |