chiark / gitweb /
Makefile: Use check_PROGRAMS target.
[mLib] / man / arena.3
index d7631c28d2fd7f260d25a71f1a8f6e65e85992bf..2a36820ecfad097978bbeb58fe4587cc67d51174 100644 (file)
@@ -1,5 +1,5 @@
 .\" -*-nroff-*-
-.TH arena 3 "3 June 2000" mLib
+.TH arena 3 "3 June 2000" "Straylight/Edgeware" "mLib utilities library"
 .SH "NAME"
 arena \- control of memory allocation
 .\" @arena_global
@@ -18,14 +18,15 @@ arena \- control of memory allocation
 .BI "arena *arena_global;"
 .BI "arena arena_stdlib;"
 
-.BI "void *arena_fakerealloc(arena *" a ", void *" p ", size_t " sz );
+.BI "void *arena_fakerealloc(arena *" a ", void *" p ,
+.BI "                        size_t " sz ", size_t " osz );
 
 .BI "void *a_alloc(arena *" a ", size_t " sz );
-.BI "void *a_realloc(arena *" a ", void *" p ", size_t " sz );
+.BI "void *a_realloc(arena *" a ", void *" p ", size_t " sz ", size_t " osz );
 .BI "void a_free(arena *" a );
 
 .BI "void *A_ALLOC(arena *" a ", size_t " sz );
-.BI "void *A_REALLOC(arena *" a ", void *" p ", size_t " sz );
+.BI "void *A_REALLOC(arena *" a ", void *" p ", size_t " sz ", size_t " osz );
 .BI "void A_FREE(arena *" a );
 .fi
 .SH "DESCRIPTION"
@@ -60,6 +61,14 @@ function-call equivalents with lower-case names too.  For a more
 convenient interface to memory allocation, see
 .BR alloc (3).
 .PP
+.B Note:
+The
+.B realloc
+function has an extra argument
+.I osz
+specifying the old size of the block.  This is for the benefit of arena
+handlers which can't easily find the old block's size.
+.PP
 .SS "Defining new arenas"
 An
 .B arena
@@ -81,10 +90,15 @@ memory allocation tasks:
 Allocates a block of memory, of at least
 .I sz
 bytes in size, appropriately aligned, and returns its address.
+.nf
 .TP
-.BI "void *(*" realloc ")(arena *" a ", void *" p ", size_t " sz );
+.BI "void *(*" realloc ")(arena *" a ", void *" p ", size_t " sz ", size_t " osz );
+.fi
 Resizes the block pointed to by
 .IR p ,
+with
+.I osz
+interesting bytes in it,
 so that it is at least
 .I sz
 bytes long.  You can use
@@ -110,4 +124,4 @@ specified by the ANSI C standard.
 .BR alloc (3),
 .BR mLib (3).
 .SH AUTHOR
-Mark Wooding, <mdw@nsict.org>
+Mark Wooding, <mdw@distorted.org.uk>