OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [alloc-pool.h] - Blame information for rev 165

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
/* Functions to support a pool of allocatable objects
2
   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2007
3
   Free Software Foundation, Inc.
4
   Contributed by Daniel Berlin <dan@cgsoftware.com>
5
 
6
This file is part of GCC.
7
 
8
GCC is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 3, or (at your option)
11
any later version.
12
 
13
GCC is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17
 
18
You should have received a copy of the GNU General Public License
19
along with GCC; see the file COPYING3.  If not see
20
<http://www.gnu.org/licenses/>.  */
21
#ifndef ALLOC_POOL_H
22
#define ALLOC_POOL_H
23
 
24
typedef unsigned long ALLOC_POOL_ID_TYPE;
25
 
26
typedef struct alloc_pool_list_def
27
{
28
  struct alloc_pool_list_def *next;
29
}
30
 *alloc_pool_list;
31
 
32
typedef struct alloc_pool_def
33
{
34
  const char *name;
35
#ifdef ENABLE_CHECKING
36
  ALLOC_POOL_ID_TYPE id;
37
#endif
38
  size_t elts_per_block;
39
  alloc_pool_list free_list;
40
  size_t elts_allocated;
41
  size_t elts_free;
42
  size_t blocks_allocated;
43
  alloc_pool_list block_list;
44
  size_t block_size;
45
  size_t elt_size;
46
}
47
 *alloc_pool;
48
 
49
extern alloc_pool create_alloc_pool (const char *, size_t, size_t);
50
extern void free_alloc_pool (alloc_pool);
51
extern void free_alloc_pool_if_empty (alloc_pool *);
52
extern void *pool_alloc (alloc_pool);
53
extern void pool_free (alloc_pool, void *);
54
extern void dump_alloc_pool_statistics (void);
55
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.