From e3c4633e3298e08018346725b1c5a7db42e19eb6 Mon Sep 17 00:00:00 2001 From: rth Date: Sat, 30 Oct 1999 21:36:13 +0000 Subject: * ggc-common.c: Update pre-function commentary. * ggc-page.c: Likewise. (poison): Remove. (poison_pages): Use memset directly. (ggc_alloc_obj): Likewise. Use a different pattern than poison_pages. (ggc_collect): Poison before sweeping. * ggc-simple.c: Update pre-function commentary. (ggc_alloc_obj): Poison non-zeroed memory. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30275 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ggc-simple.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc/ggc-simple.c') diff --git a/gcc/ggc-simple.c b/gcc/ggc-simple.c index 194863edc7d..53d6579dbac 100644 --- a/gcc/ggc-simple.c +++ b/gcc/ggc-simple.c @@ -200,6 +200,10 @@ ggc_alloc_obj (size, zero) if (zero) memset (&x->u, 0, size); +#ifdef GGC_POISON + else + memset (&x->u, 0xaf, size); +#endif tree_insert (x); G.allocated += size; @@ -232,6 +236,8 @@ ggc_set_mark (p) return 0; } +/* Mark a node, but check first to see that it's really gc-able memory. */ + void ggc_mark_if_gcable (p) void *p; @@ -253,6 +259,8 @@ ggc_mark_if_gcable (p) G.objects += 1; } +/* Return the size of the gc-able object P. */ + size_t ggc_get_size (p) void *p; @@ -262,6 +270,8 @@ ggc_get_size (p) return x->size; } +/* Unmark all objects. */ + static void clear_marks (x) struct ggc_mem *x; @@ -273,6 +283,8 @@ clear_marks (x) clear_marks (x->sub[1]); } +/* Free all objects in the current context that are not marked. */ + static void sweep_objs (root) struct ggc_mem **root; -- cgit v1.2.1