Print this page
more copy-editting from Josh


  59 .Bl -tag -width Ds
  60 .It Fa name
  61 A character string giving a name to the vmem
  62 arena to be created.
  63 .It Fa base
  64 An address indicating the lowest possible value in the arena.
  65 .It Fa size
  66 The size of the arena to create.
  67 .It Fa quantum
  68 The arena's
  69 .Dq quantum .
  70 The granularity of the arena.  The amount allocated at minimum by each
  71 request.  Must be a power of 2.
  72 .It Fa afunc
  73 A function which is called to import new spans from
  74 .Fa source ,
  75 which may be
  76 .Dv NULL
  77 if this arena does not import from another.
  78 When calling
  79 .Fn vmem_create
  80 .Fa afunc
  81 is an
  82 .Vt vmem_alloc_t
  83 a function taking three parameters and returning a pointer to
  84 .Vt void
  85 (the imported space):
  86 .Bl -tag -width Ds
  87 .It Fa "vmem_t *"
  88 The source arena from which we'll import.  The
  89 .Fa source
  90 argument to
  91 .Fn vmem_create .
  92 .It Fa size_t
  93 The size to import
  94 .It Fa int
  95 The
  96 .Fa vmflag
  97 argument used for the import.
  98 .El
  99 .Pp
 100 When calling
 101 .Fn vmem_xcreate
 102 .Fa afunc
 103 is an
 104 .Vt vmem_ximport_t
 105 a function taking four parameters and returning a pointer to
 106 .Vt void
 107 (the imported space):
 108 .Bl -tag -width Ds
 109 .It Fa "vmem_t *"
 110 The source arena from which we'll import.  The
 111 .Fa source
 112 argument to
 113 .Fn vmem_xcreate .
 114 .It Fa "size_t *"
 115 The size of the import,
 116 .Fa afunc
 117 may
 118 .Em increase
 119 this size if that is desirable, but must never decrease it.
 120 .It Fa size_t
 121 The desired alignment of the imported space.
 122 .It Fa int
 123 the
 124 .Fa vmflag
 125 argument used for the import.
 126 .El
 127 .It Fa ffunc
 128 A function which is called to return spans to
 129 .Fa source ,
 130 which may be
 131 .Dv NULL
 132 if this arena does not import from another.
 133 This is a
 134 .Vt vmem_free_t
 135 a function taking three parametes and returning void:
 136 .Bl -tag -width Ds
 137 .It Fa "vmem_t"
 138 The arena to which space is being returned.  The
 139 .Fa source
 140 argument to
 141 .Fn vmem_create
 142 or
 143 .Fn vmem_xcreate .
 144 .It Fa "void *"
 145 The span being returned to the source arena.
 146 .It Fa "size_t"
 147 The size of the span being returned to the source arena.
 148 .El
 149 .It Fa source
 150 An arena from which this arena will import,
 151 which may be
 152 .Dv NULL
 153 if this arena does not import from another.
 154 .It Fa qcache_max
 155 Each arena offers caching of integer multiples of




  59 .Bl -tag -width Ds
  60 .It Fa name
  61 A character string giving a name to the vmem
  62 arena to be created.
  63 .It Fa base
  64 An address indicating the lowest possible value in the arena.
  65 .It Fa size
  66 The size of the arena to create.
  67 .It Fa quantum
  68 The arena's
  69 .Dq quantum .
  70 The granularity of the arena.  The amount allocated at minimum by each
  71 request.  Must be a power of 2.
  72 .It Fa afunc
  73 A function which is called to import new spans from
  74 .Fa source ,
  75 which may be
  76 .Dv NULL
  77 if this arena does not import from another.
  78 When calling
  79 .Fn vmem_create ,
  80 .Fa afunc
  81 is a
  82 .Vt vmem_alloc_t ,
  83 a function taking three parameters and returning a pointer to
  84 .Vt void
  85 (the imported space):
  86 .Bl -tag -width Ds
  87 .It Fa "vmem_t *"
  88 The source arena from which we'll import.  The
  89 .Fa source
  90 argument to
  91 .Fn vmem_create .
  92 .It Fa size_t
  93 The size to import.
  94 .It Fa int
  95 The
  96 .Fa vmflag
  97 argument used for the import.
  98 .El
  99 .Pp
 100 When calling
 101 .Fn vmem_xcreate ,
 102 .Fa afunc
 103 is a
 104 .Vt vmem_ximport_t ,
 105 a function taking four parameters and returning a pointer to
 106 .Vt void
 107 (the imported space):
 108 .Bl -tag -width Ds
 109 .It Fa "vmem_t *"
 110 The source arena from which we'll import.  The
 111 .Fa source
 112 argument to
 113 .Fn vmem_xcreate .
 114 .It Fa "size_t *"
 115 The size of the import.
 116 .Fa afunc
 117 may
 118 .Em increase
 119 this size if that is desirable, but must never decrease it.
 120 .It Fa size_t
 121 The desired alignment of the imported space.
 122 .It Fa int
 123 The
 124 .Fa vmflag
 125 argument used for the import.
 126 .El
 127 .It Fa ffunc
 128 A function which is called to return spans to
 129 .Fa source ,
 130 which may be
 131 .Dv NULL
 132 if this arena does not import from another.
 133 This is a
 134 .Vt vmem_free_t ,
 135 a function taking three parameters and returning void:
 136 .Bl -tag -width Ds
 137 .It Fa "vmem_t"
 138 The arena to which space is being returned.  The
 139 .Fa source
 140 argument to
 141 .Fn vmem_create
 142 or
 143 .Fn vmem_xcreate .
 144 .It Fa "void *"
 145 The span being returned to the source arena.
 146 .It Fa "size_t"
 147 The size of the span being returned to the source arena.
 148 .El
 149 .It Fa source
 150 An arena from which this arena will import,
 151 which may be
 152 .Dv NULL
 153 if this arena does not import from another.
 154 .It Fa qcache_max
 155 Each arena offers caching of integer multiples of