Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_malloc.c
Show First 20 Lines • Show All 798 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
if (WOULD_OVERFLOW(nmemb, size)) | if (WOULD_OVERFLOW(nmemb, size)) | ||||
panic("mallocarray: %zu * %zu overflowed", nmemb, size); | panic("mallocarray: %zu * %zu overflowed", nmemb, size); | ||||
return (malloc(size * nmemb, type, flags)); | return (malloc(size * nmemb, type, flags)); | ||||
} | } | ||||
void * | |||||
mallocarray_domainset(size_t nmemb, size_t size, struct malloc_type *type, struct domainset *ds, int flags) | |||||
kib: This line looks too long.
kern_malloc.c/malloc.h bits should be committed separately. | |||||
{ | |||||
if (WOULD_OVERFLOW(nmemb, size)) | |||||
panic("mallocarray_domainset: %zu * %zu overflowed", nmemb, size); | |||||
return (malloc_domainset(size * nmemb, type, ds, flags)); | |||||
} | |||||
#ifdef INVARIANTS | #ifdef INVARIANTS | ||||
static void | static void | ||||
free_save_type(void *addr, struct malloc_type *mtp, u_long size) | free_save_type(void *addr, struct malloc_type *mtp, u_long size) | ||||
{ | { | ||||
struct malloc_type **mtpp = addr; | struct malloc_type **mtpp = addr; | ||||
/* | /* | ||||
* Cache a pointer to the malloc_type that most recently freed | * Cache a pointer to the malloc_type that most recently freed | ||||
▲ Show 20 Lines • Show All 698 Lines • Show Last 20 Lines |
This line looks too long.
kern_malloc.c/malloc.h bits should be committed separately.