summaryrefslogtreecommitdiff
path: root/gcc/ggc-simple.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-30 21:36:13 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-30 21:36:13 +0000
commite3c4633e3298e08018346725b1c5a7db42e19eb6 (patch)
treec179cab27ce27f6172b9dfdffd3e669d553f80f3 /gcc/ggc-simple.c
parent4d678e392122d240f5c07846e2767cfac3b3d918 (diff)
downloadgcc-e3c4633e3298e08018346725b1c5a7db42e19eb6.tar.gz
* 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
Diffstat (limited to 'gcc/ggc-simple.c')
-rw-r--r--gcc/ggc-simple.c12
1 files changed, 12 insertions, 0 deletions
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;