Deleted Added
full compact
zone.9 (107032) zone.9 (107383)
1.\"-
2.\" Copyright (c) 2001 Dag-Erling Co�dan Sm�rgrav
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
1.\"-
2.\" Copyright (c) 2001 Dag-Erling Co�dan Sm�rgrav
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD: head/share/man/man9/zone.9 107032 2002-11-18 01:11:58Z alfred $
26.\" $FreeBSD: head/share/man/man9/zone.9 107383 2002-11-29 11:39:20Z ru $
27.\"
28.Dd May 18, 2002
29.Dt ZONE 9
30.Os
31.Sh NAME
32.Nm uma_zcreate ,
33.Nm uma_zalloc ,
34.Nm uma_zfree ,

--- 61 unchanged lines hidden (view full) ---

96.Fa ctor
97and
98.Fa dtor
99arguments are callback functions that are called by
100the uma subsystem at the time of the call to
101.Fn uma_zalloc
102and
103.Fn uma_zfree
27.\"
28.Dd May 18, 2002
29.Dt ZONE 9
30.Os
31.Sh NAME
32.Nm uma_zcreate ,
33.Nm uma_zalloc ,
34.Nm uma_zfree ,

--- 61 unchanged lines hidden (view full) ---

96.Fa ctor
97and
98.Fa dtor
99arguments are callback functions that are called by
100the uma subsystem at the time of the call to
101.Fn uma_zalloc
102and
103.Fn uma_zfree
104respectively. Their purpose is to provide hooks for initializing or
104respectively.
105Their purpose is to provide hooks for initializing or
105destroying things that need to be done at the time of the allocation
106destroying things that need to be done at the time of the allocation
106or release of a resource. A good useage for the
107or release of a resource.
108A good useage for the
107.Fa ctor
108and
109.Fa dtor
110callbacks
111might be to adjust a global count of the number of objects allocated.
112.Pp
113The
114.Fa uminit
115and
116.Fa fini
117arguments are used to optimize the allocation of
109.Fa ctor
110and
111.Fa dtor
112callbacks
113might be to adjust a global count of the number of objects allocated.
114.Pp
115The
116.Fa uminit
117and
118.Fa fini
119arguments are used to optimize the allocation of
118objects from the zone. They are called by the uma subsystem whenever
120objects from the zone.
121They are called by the uma subsystem whenever
119it needs to allocate or free several items to satisfy requests or memory
122it needs to allocate or free several items to satisfy requests or memory
120pressure. A good use for the uminit and fini callbacks might be to
121initialize and destroy mutexes contained within the object. This would
123pressure.
124A good use for the
125.Fa uminit
126and
127.Fa fini
128callbacks might be to
129initialize and destroy mutexes contained within the object.
130This would
122allow one to re-use already initialized mutexes when an object is returned
131allow one to re-use already initialized mutexes when an object is returned
123from the uma subsystem's object cache. They are not called on each call
124to
132from the uma subsystem's object cache.
133They are not called on each call to
125.Fn uma_zalloc
126and
127.Fn uma_zfree
128but rather in a batch mode on several objects.
129.Pp
130To allocate an item from a zone, simply call
131.Fn uma_zalloc
132with a pointer to that zone

--- 55 unchanged lines hidden ---
134.Fn uma_zalloc
135and
136.Fn uma_zfree
137but rather in a batch mode on several objects.
138.Pp
139To allocate an item from a zone, simply call
140.Fn uma_zalloc
141with a pointer to that zone

--- 55 unchanged lines hidden ---