2 /* Functions to support a pool of allocatable objects
3 Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
4 Contributed by Daniel Berlin <dan@cgsoftware.com>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
24 typedef struct alloc_pool_list_def
26 struct alloc_pool_list_def
*next
;
30 typedef struct alloc_pool_def
33 size_t elts_per_block
;
34 alloc_pool_list free_list
;
35 size_t elts_allocated
;
37 size_t blocks_allocated
;
38 alloc_pool_list block_list
;
44 extern alloc_pool create_alloc_pool
PARAMS ((const char *, size_t, size_t));
45 extern void free_alloc_pool
PARAMS ((alloc_pool
));
46 extern void *pool_alloc
PARAMS ((alloc_pool
));
47 extern void pool_free
PARAMS ((alloc_pool
, void *));