summaryrefslogtreecommitdiff
path: root/gcc/alloc-pool.h
diff options
context:
space:
mode:
authorzlomek <zlomek@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-12 05:16:55 +0000
committerzlomek <zlomek@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-12 05:16:55 +0000
commita5f52a4548046ea51b00bd465af7d6e7b90c9ad3 (patch)
tree29d4dc1fdfe78b727f24ca1dd297d829aa75218f /gcc/alloc-pool.h
parent4d2aa485d66d731a3726186c5be15f869b5895f9 (diff)
downloadgcc-a5f52a4548046ea51b00bd465af7d6e7b90c9ad3.tar.gz
* alloc-pool.h (ALLOC_POOL_ID_TYPE): New type.
(struct alloc_pool_def): New element 'id'. * alloc-pool.c (fancy_abort): Extern function prototype. (abort): Macro which uses fancy_abort. (struct allocation_object_def): New structure. (ALLOCATION_OBJECT_PTR_FROM_USER_PTR): New macro. (USER_PTR_FROM_ALLOCATION_OBJECT_PTR): New macro. (last_id): New variable. (create_alloc_pool): Add the offset of u.data to size of element, increase and use last_id. (free_alloc_pool): Do the checking only when ENABLE_CHECKING. (pool_alloc): Likewise. Set ID for elements. (pool_free): Check whether the PTR was allocated from POOL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66711 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alloc-pool.h')
-rw-r--r--gcc/alloc-pool.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/alloc-pool.h b/gcc/alloc-pool.h
index 6038a03c31d..0310caf0156 100644
--- a/gcc/alloc-pool.h
+++ b/gcc/alloc-pool.h
@@ -1,7 +1,8 @@
-
/* Functions to support a pool of allocatable objects
- Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003
+ Free Software Foundation, Inc.
Contributed by Daniel Berlin <dan@cgsoftware.com>
+
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
@@ -21,6 +22,8 @@ Boston, MA 02111-1307, USA. */
#ifndef ALLOC_POOL_H
#define ALLOC_POOL_H
+typedef unsigned long ALLOC_POOL_ID_TYPE;
+
typedef struct alloc_pool_list_def
{
struct alloc_pool_list_def *next;
@@ -30,6 +33,9 @@ typedef struct alloc_pool_list_def
typedef struct alloc_pool_def
{
char *name;
+#ifdef ENABLE_CHECKING
+ ALLOC_POOL_ID_TYPE id;
+#endif
size_t elts_per_block;
alloc_pool_list free_list;
size_t elts_allocated;