aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-08-11 12:37:19 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-08-11 12:37:19 +0000
commitbef985f3f69e6f63b144e936b599517e2d6b0601 (patch)
treefcbebbbfda56236b89a255fb6864d9fcde8b6022 /gcc/cpplib.c
parent4d5f3fbd61ad7e6a13424fa720bda3888d6ef429 (diff)
downloadgcc-bef985f3f69e6f63b144e936b599517e2d6b0601.zip
gcc-bef985f3f69e6f63b144e936b599517e2d6b0601.tar.gz
gcc-bef985f3f69e6f63b144e936b599517e2d6b0601.tar.bz2
cpphash.c (_cpp_destroy_hashtable): Use ht_destroy.
* cpphash.c (_cpp_destroy_hashtable): Use ht_destroy. * cpphash.h (CPP_IN_SYSTEM_HEADER): Fix. (struct cpp_pool): New member first. * cppinit.c (append_include_chain): Plug memory leaks. * cpplib.c (cpp_register_pragma, cpp_register_pragma_space): Allocate pragma structures from the (aligned) macro pool to avoid leaking memory. * cpplex.c (_cpp_init_pool, _cpp_free_pool): Use pool->first so we don't leak memory. * hashtable.c (ht_destroy): New. * hashtable.h (ht_destroy): New. From-SVN: r44794
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 719daaa..9404a00 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -901,7 +901,8 @@ cpp_register_pragma (pfile, space, name, handler)
}
found:
- new = xnew (struct pragma_entry);
+ new = (struct pragma_entry *)
+ _cpp_pool_alloc (&pfile->macro_pool, sizeof (struct pragma_entry));
new->name = name;
new->len = strlen (name);
new->isnspace = 0;
@@ -929,7 +930,8 @@ cpp_register_pragma_space (pfile, space)
p = p->next;
}
- new = xnew (struct pragma_entry);
+ new = (struct pragma_entry *)
+ _cpp_pool_alloc (&pfile->macro_pool, sizeof (struct pragma_entry));
new->name = space;
new->len = len;
new->isnspace = 1;