chiark / gitweb /
cleanup: All the whitespace fixes, all at once.
[mLib] / man / pool.3
index 182215a09561431ed86575b6adc2852f0f9a1e22..4881bf15a1ce526bd04e1b9c4d1a70bd95c56efa 100644 (file)
 .RE
 .sp 1
 ..
-.TH pool 3 "7 July 2000" mLib
+.TH pool 3 "7 July 2000" "Straylight/Edgeware" "mLib utilities library"
 .SH "NAME"
 pool \- resource pool management
 .\" @pool_alloc
 .\" @pool_strdup
+.\" @pool_init
 .\" @pool_create
 .\" @pool_destroy
 .\" @pool_sub
@@ -28,6 +29,7 @@ pool \- resource pool management
 .nf
 .B "#include <mLib/pool.h>"
 
+.BI "void pool_init(pool *" p ", arena *" a );
 .BI "pool *pool_create(arena *" a );
 .BI "pool *pool_sub(pool *" p );
 .BI "void pool_destroy(pool *" p );
@@ -52,7 +54,7 @@ of simultaneously.
 A pool may be a
 .IR "root pool" ,
 in which case it stands on its own, or it may be a
-.IR "subpool" 
+.IR "subpool"
 of another pool (which may in turn either be a root pool or a subpool of
 another).
 .PP
@@ -76,6 +78,11 @@ of avoiding memory leaks.
 A new root pool is created using
 .BR pool_create ,
 passing it an arena from which it can allocate large memory blocks.
+Alternatively, you can allocate a
+.B pool
+structure from somewhere and initialize it by passing its address and an
+arena to
+.BR pool_init .
 .PP
 A subpool is created by calling
 .BR pool_sub ,
@@ -83,10 +90,14 @@ naming the parent pool.
 .PP
 Pools are destroyed by passing them to
 .BR pool_destroy .
-Root pools are completely destroyed, since the memory containing the
-pool structure is allocated from the pool itself.  Subpools, on the
-other hand, are allocated from a parent pool, and may be reused after
-being `destroyed'.
+Pools created by
+.B pool_create
+are completely destroyed, since the memory containing the pool structure
+is allocated from the pool itself.  Subpools and pools allocated by the
+caller and initialized by
+.BR pool_init ,
+on the other hand, are
+allocated from a parent pool, and may be reused after being `destroyed'.
 .SS "Memory allocation"
 Memory is allocated from a pool by calling
 .BR pool_alloc ,
@@ -162,4 +173,4 @@ out; it's just not a disaster if you forget by accident.
 .BR mLib (3),
 .BR subarena (3).
 .SH AUTHOR
-Mark Wooding, <mdw@nsict.org>
+Mark Wooding, <mdw@distorted.org.uk>