| 553 | |
| 554 | #ifdef M_NOWAIT |
| 555 | static inline int |
| 556 | malloc2vm_flags(int malloc_flags) |
| 557 | { |
| 558 | int pflags; |
| 559 | |
| 560 | KASSERT((malloc_flags & M_USE_RESERVE) == 0 || |
| 561 | (malloc_flags & M_NOWAIT) != 0, |
| 562 | ("M_USE_RESERVE requires M_NOWAIT")); |
| 563 | pflags = (malloc_flags & M_USE_RESERVE) != 0 ? VM_ALLOC_INTERRUPT : |
| 564 | VM_ALLOC_SYSTEM; |
| 565 | if ((malloc_flags & M_ZERO) != 0) |
| 566 | pflags |= VM_ALLOC_ZERO; |
| 567 | if ((malloc_flags & M_NODUMP) != 0) |
| 568 | pflags |= VM_ALLOC_NODUMP; |
| 569 | if ((malloc_flags & M_NOWAIT)) |
| 570 | pflags |= VM_ALLOC_NOWAIT; |
| 571 | if ((malloc_flags & M_WAITOK)) |
| 572 | pflags |= VM_ALLOC_WAITOK; |
| 573 | return (pflags); |
| 574 | } |
| 575 | #endif |
| 576 | |
| 577 | /* |
no outgoing calls
no test coverage detected