Main index | Section 9 | Options |
#include <sys/types.h>
#include <sys/malloc.h>
#include <sys/param.h>
#include <sys/domainset.h>
The contigmalloc_domainset() variant allows the caller to additionally specify a numa(4) domain selection policy. See domainset(9) for some example policies.
The flags parameter modifies contigmalloc()'s behaviour as follows:
M_ZERO | |
Causes the allocated physical memory to be zero filled. | |
M_NOWAIT | |
Causes contigmalloc() to return NULL if the request cannot be immediately fulfilled due to resource shortage. | |
Other flags (if present) are ignored.
The contigfree() function deallocates memory allocated by a previous call to contigmalloc() or contigmalloc_domainset().
The contigfree() function does not accept NULL as an address input, unlike free(9).
void *p; p = contigmalloc(8192, M_DEVBUF, M_ZERO, 0, (1L << 22), 32 * 1024, 1024 * 1024);
Ask for 8192 bytes of zero-filled memory residing between physical address 0 and 4194303 inclusive, aligned to a 32K boundary and not crossing a 1M address boundary.
CONTIGMALLOC (9) | October 30, 2018 |
Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | A UNIX saleslady, Lenore, Enjoys work, but she likes the beach more. She found a good way To combine work and play: She sells C shells by the seashore. |
” |