diff options
author | alfred <alfred@FreeBSD.org> | 2002-11-18 01:11:58 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-11-18 01:11:58 +0000 |
commit | b80f7ad39fcd5c6c37fa3a736bcc054736ce666b (patch) | |
tree | 9b0b5940ad074409b35a33775df959cc8305d003 /share | |
parent | 1b82dc8de943bca69b32a43341988477d8b41edd (diff) | |
download | FreeBSD-src-b80f7ad39fcd5c6c37fa3a736bcc054736ce666b.zip FreeBSD-src-b80f7ad39fcd5c6c37fa3a736bcc054736ce666b.tar.gz |
Flesh out the description of the uma_zcreate callback function arguements
a bit. As there may be changes soon we're still a bit vague unfortunatly.
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/zone.9 | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/share/man/man9/zone.9 b/share/man/man9/zone.9 index 30d8c39..48309b6 100644 --- a/share/man/man9/zone.9 +++ b/share/man/man9/zone.9 @@ -92,6 +92,41 @@ The argument is a text name of the zone for debugging and stats; this memory should not be freed until the zone has been deallocated. .Pp +The +.Fa ctor +and +.Fa dtor +arguments are callback functions that are called by +the uma subsystem at the time of the call to +.Fn uma_zalloc +and +.Fn uma_zfree +respectively. Their purpose is to provide hooks for initializing or +destroying things that need to be done at the time of the allocation +or release of a resource. A good useage for the +.Fa ctor +and +.Fa dtor +callbacks +might be to adjust a global count of the number of objects allocated. +.Pp +The +.Fa uminit +and +.Fa fini +arguments are used to optimize the allocation of +objects from the zone. They are called by the uma subsystem whenever +it needs to allocate or free several items to satisfy requests or memory +pressure. A good use for the uminit and fini callbacks might be to +initialize and destroy mutexes contained within the object. This would +allow one to re-use already initialized mutexes when an object is returned +from the uma subsystem's object cache. They are not called on each call +to +.Fn uma_zalloc +and +.Fn uma_zfree +but rather in a batch mode on several objects. +.Pp To allocate an item from a zone, simply call .Fn uma_zalloc with a pointer to that zone |