diff options
Diffstat (limited to 'gcc/ggc-simple.c')
-rw-r--r-- | gcc/ggc-simple.c | 12 |
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; |