Print this page
code review from Josh and Robert

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man9f/vmem_alloc.9f
          +++ new/usr/src/man/man9f/vmem_alloc.9f
↓ open down ↓ 64 lines elided ↑ open up ↑
  65   65  .Dv VM_SLEEP
  66   66  or
  67   67  .Dv VM_NOSLEEP
  68   68  must be specified, and indicate whether the allocation may block.  A
  69   69  .Dv VM_SLEEP
  70   70  allocation can never fail but may block indefinitely.
  71   71  .Pp
  72   72  The allocation policy may be specified by one of the following flags:
  73   73  .Bl -tag -width Ds
  74   74  .It Dv VM_BESTFIT
  75      -Take the segment from the smallest free segment that could satisfy this allocation
       75 +Take the segment from the smallest free segment that could satisfy this allocation.
  76   76  .It Dv VM_FIRSTFIT
  77   77  Take the segment from the first free segment found that could satisfy this
  78   78  allocation.
  79   79  .It Dv VM_NEXTFIT
  80   80  Take the segment from the segment after the one previously allocated.  This
  81   81  provides sequential behaviour useful when allocating identifiers from a
  82   82  .Dv VMC_IDENTIFIER
  83   83  arena.
  84   84  .It Dv VM_ENDALLOC
  85   85  May be specified in combination with
  86   86  .Dv VM_BESTFIT ,
  87   87  .Dv VM_FIRSTFIT
  88   88  or the default policy to indicate that the higher addresses should be
  89   89  preferred.
  90   90  .El
  91   91  .Pp
  92      -The default (un\-named) allocation policy is
  93      -.Dq instant fit
       92 +The default (unnamed) allocation policy is
       93 +.Dq "instant fit" ,
  94   94  an approximation of
  95   95  .Dv VM_BESTFIT
  96   96  in guaranteed constant time.
  97   97  .It Fa align_arg
  98      -The minimum alignment of the allocation.  If
  99      -.Ql 0
       98 +The minimum alignment of the allocation.  If 0,
 100   99  the allocated segment will be aligned as the arena's quantum.
 101  100  .It Fa phase
 102  101  The allocated segment must be
 103  102  .Fa phase
 104  103  bytes from the alignment boundary.
 105  104  .It Fa nocross
 106  105  The allocated segment may not straddle a
 107  106  .Fa nocross
 108  107  alignment boundary.
 109  108  .It Fa minaddr
↓ open down ↓ 12 lines elided ↑ open up ↑
 122  121  .Fn vmem_alloc
 123  122  and
 124  123  .Fn vmem_xalloc
 125  124  functions allocate a segment of
 126  125  .Fa size
 127  126  length from the vmem arena
 128  127  .Fa vmp .
 129  128  .Pp
 130  129  The
 131  130  .Fa vmflag
 132      -argument controls the behaviour of the allocation.  As described in
 133      -.Sx PARAMETERS
      131 +argument controls the behaviour of the allocation, as described in
      132 +.Sx PARAMETERS .
 134  133  .Pp
 135  134  For allocations with complex requirements, such as those used for DMA
 136  135  .Fn vmem_xalloc
 137  136  takes additional arguments allowing those requirements to be expressed.
 138  137  .Pp
 139  138  Segments allocated with
 140  139  .Fn vmem_xalloc
 141  140  must always be freed with
 142  141  .Fn vmem_xfree ,
 143  142  since these allocations are uncached.
↓ open down ↓ 14 lines elided ↑ open up ↑
 158  157  to which it points.
 159  158  .Pp
 160  159  On failure,
 161  160  .Dv NULL
 162  161  is returned.
 163  162  When the
 164  163  .Dv VM_SLEEP
 165  164  flag is specified, these functions can never fail (but may block forever).
 166  165  .Sh SEE ALSO
 167  166  .Xr vmem 9 ,
      167 +.Xr vmem_contains 9F ,
 168  168  .Xr vmem_create 9F
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX