Explicitely state that M_USE_RESERVE requires M_NOWAIT, using assertion.

Reviewed by:	alc
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2012-11-16 05:49:56 +00:00
parent 94e7929e2c
commit 962b064afe
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=243131

View File

@ -353,6 +353,9 @@ malloc2vm_flags(int malloc_flags)
{
int pflags;
KASSERT((malloc_flags & M_USE_RESERVE) == 0 ||
(malloc_flags & M_NOWAIT) != 0,
("M_USE_RESERVE requires M_NOWAIT"));
pflags = (malloc_flags & M_USE_RESERVE) != 0 ? VM_ALLOC_INTERRUPT :
VM_ALLOC_SYSTEM;
if ((malloc_flags & M_ZERO) != 0)