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(). Its use is deprecated in favor of free(9) which no longer requires the caller to know the size and also accepts NULL as an address.
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) | July 22, 2024 |
Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | F U cn rd dis U mst uz Unix. | ” |