2 Header file for uuconf memory allocation routines.
4 Copyright (C) 1992 Ian Lance Taylor
6 This file is part of the Taylor UUCP uuconf library.
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public License
10 as published by the Free Software Foundation; either version 2 of
11 the License, or (at your option) any later version.
13 This library is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
18 You should have received a copy of the GNU Library General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 The author of the program may be contacted at ian@airs.com or
23 c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
26 /* This header file is private to the uuconf memory allocation
27 routines, and should not be included by any other files. */
29 /* We want to be able to keep track of allocated memory blocks, so
30 that we can free them up later. This will let us free up all the
31 memory allocated to hold information for a system, for example. We
32 do this by allocating large chunks and doling them out. Calling
33 uuconf_malloc_block will return a pointer to a magic cookie which
34 can then be passed to uuconf_malloc and uuconf_free. Passing the
35 pointer to uuconf_free_block will free all memory allocated for
38 /* We allocate this much space in each block. On most systems, this
39 will make the actual structure 1024 bytes, which may be convenient
40 for some types of memory allocators. */
41 #define CALLOC_SIZE (1008)
43 /* This is the actual structure of a block. */
46 /* Next block in linked list. */
48 /* Index of next free spot. */
50 /* Last value returned by uuconf_malloc for this block. */
52 /* List of additional memory blocks. */
53 struct sadded *qadded;
54 /* Buffer of data. We put it in a union with a double to make sure
55 it is adequately aligned. */
63 /* There is a linked list of additional memory blocks inserted by
67 /* The next in the list. */
69 /* The added block. */