Print this page
code review from Josh and Robert

*** 70,80 **** allocation can never fail but may block indefinitely. .Pp The allocation policy may be specified by one of the following flags: .Bl -tag -width Ds .It Dv VM_BESTFIT ! Take the segment from the smallest free segment that could satisfy this allocation .It Dv VM_FIRSTFIT Take the segment from the first free segment found that could satisfy this allocation. .It Dv VM_NEXTFIT Take the segment from the segment after the one previously allocated. This --- 70,80 ---- allocation can never fail but may block indefinitely. .Pp The allocation policy may be specified by one of the following flags: .Bl -tag -width Ds .It Dv VM_BESTFIT ! Take the segment from the smallest free segment that could satisfy this allocation. .It Dv VM_FIRSTFIT Take the segment from the first free segment found that could satisfy this allocation. .It Dv VM_NEXTFIT Take the segment from the segment after the one previously allocated. This
*** 87,104 **** .Dv VM_FIRSTFIT or the default policy to indicate that the higher addresses should be preferred. .El .Pp ! The default (un\-named) allocation policy is ! .Dq instant fit an approximation of .Dv VM_BESTFIT in guaranteed constant time. .It Fa align_arg ! The minimum alignment of the allocation. If ! .Ql 0 the allocated segment will be aligned as the arena's quantum. .It Fa phase The allocated segment must be .Fa phase bytes from the alignment boundary. --- 87,103 ---- .Dv VM_FIRSTFIT or the default policy to indicate that the higher addresses should be preferred. .El .Pp ! The default (unnamed) allocation policy is ! .Dq "instant fit" , an approximation of .Dv VM_BESTFIT in guaranteed constant time. .It Fa align_arg ! The minimum alignment of the allocation. If 0, the allocated segment will be aligned as the arena's quantum. .It Fa phase The allocated segment must be .Fa phase bytes from the alignment boundary.
*** 127,138 **** length from the vmem arena .Fa vmp . .Pp The .Fa vmflag ! argument controls the behaviour of the allocation. As described in ! .Sx PARAMETERS .Pp For allocations with complex requirements, such as those used for DMA .Fn vmem_xalloc takes additional arguments allowing those requirements to be expressed. .Pp --- 126,137 ---- length from the vmem arena .Fa vmp . .Pp The .Fa vmflag ! argument controls the behaviour of the allocation, as described in ! .Sx PARAMETERS . .Pp For allocations with complex requirements, such as those used for DMA .Fn vmem_xalloc takes additional arguments allowing those requirements to be expressed. .Pp
*** 163,168 **** --- 162,168 ---- When the .Dv VM_SLEEP flag is specified, these functions can never fail (but may block forever). .Sh SEE ALSO .Xr vmem 9 , + .Xr vmem_contains 9F , .Xr vmem_create 9F