@@@ wip type definitions in manpage synopses
[mLib] / mem / arena.3
index 2a36820..3baf4e6 100644 (file)
@@ -15,6 +15,17 @@ arena \- control of memory allocation
 .nf
 .B "#include <mLib/arena.h>"
 
+.B "typedef struct {"
+.B "\h'4n'const struct arena_ops *ops";
+.B "} arena;"
+
+.B "typedef struct {"
+.BI "\h'4n'void *(*alloc)(arena *" a ", size_t " sz );
+.BI "\h'4n'void *(*realloc)(arena *" a ", void *" p ", size_t " sz ", size_t " osz );
+.BI "\h'4n'void *(*free)(arena *" a ", void *" p );
+.BI "\h'4n'void *(*purge)(arena *" a );
+.B "} arena_ops;"
+
 .BI "arena *arena_global;"
 .BI "arena arena_stdlib;"
 
@@ -86,13 +97,13 @@ The
 table contains function pointers which are called to perform various
 memory allocation tasks:
 .TP
-.BI "void *(*" alloc ")(arena *" a ", size_t " sz );
+.BI "void *(*alloc)(arena *" a ", size_t " sz );
 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 ", size_t " osz );
+.BI "void *(*realloc)(arena *" a ", void *" p ", size_t " sz ", size_t " osz );
 .fi
 Resizes the block pointed to by
 .IR p ,
@@ -106,11 +117,11 @@ bytes long.  You can use
 here, to fake resizing by allocating, copying and freeing, if your arena
 doesn't make doing something more efficient easy.
 .TP
-.BI "void (*" free ")(arena *" a ", void *" p );
+.BI "void (*free)(arena *" a ", void *" p );
 Frees the block pointed to by
 .IR p .
 .TP
-.BI "void (*" purge ")(arena *" a );
+.BI "void (*purge)(arena *" a );
 Frees all blocks in the arena.  Used when the arena is being destroyed.
 .PP
 The behaviour of the