Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_malloc.c
Show First 20 Lines • Show All 612 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
int indx; | int indx; | ||||
caddr_t va; | caddr_t va; | ||||
uma_zone_t zone; | uma_zone_t zone; | ||||
#if defined(DEBUG_REDZONE) | #if defined(DEBUG_REDZONE) | ||||
unsigned long osize = size; | unsigned long osize = size; | ||||
#endif | #endif | ||||
KASSERT((flags & M_WAITOK) == 0 || THREAD_CAN_SLEEP(), | |||||
("malloc(M_WAITOK) in non-sleepable context")); | |||||
markj: Why not check it in UMA as well? | |||||
#ifdef MALLOC_DEBUG | #ifdef MALLOC_DEBUG | ||||
va = NULL; | va = NULL; | ||||
if (malloc_dbg(&va, &size, mtp, flags) != 0) | if (malloc_dbg(&va, &size, mtp, flags) != 0) | ||||
return (va); | return (va); | ||||
#endif | #endif | ||||
if (size <= kmem_zmax && (flags & M_EXEC) == 0) { | if (size <= kmem_zmax && (flags & M_EXEC) == 0) { | ||||
if (size & KMEM_ZMASK) | if (size & KMEM_ZMASK) | ||||
▲ Show 20 Lines • Show All 817 Lines • Show Last 20 Lines |
Why not check it in UMA as well?