From 5058afdcbede2d421a1cb8fec55303e112d97b11 Mon Sep 17 00:00:00 2001 From: mmitchel Date: Wed, 7 Sep 2005 03:50:08 +0000 Subject: * ggc-page.c (ggc_push_context): Remove. (ggc_pop_context): Likewise. * ggc.h (ggc_push_context): Remove. (ggc_pop_context): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103979 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++ gcc/ggc-page.c | 95 ---------------------------------------------------------- gcc/ggc.h | 8 ----- 3 files changed, 7 insertions(+), 103 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5fae469ddeb..65f3ff1dc98 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-09-06 Mark Mitchell + + * ggc-page.c (ggc_push_context): Remove. + (ggc_pop_context): Likewise. + * ggc.h (ggc_push_context): Remove. + (ggc_pop_context): Likewise. + 2005-09-06 Saurabh Verma PR target/8973 diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index 85b73adf8af..f9e64879d2e 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -1540,18 +1540,6 @@ destroy_ggc_zone (struct alloc_zone *zone ATTRIBUTE_UNUSED) { } -/* Increment the `GC context'. Objects allocated in an outer context - are never freed, eliminating the need to register their roots. */ - -void -ggc_push_context (void) -{ - ++G.context_depth; - - /* Die on wrap. */ - gcc_assert (G.context_depth < HOST_BITS_PER_LONG); -} - /* Merge the SAVE_IN_USE_P and IN_USE_P arrays in P so that IN_USE_P reflects reality. Recalculate NUM_FREE_OBJECTS as well. */ @@ -1587,89 +1575,6 @@ ggc_recalculate_in_use_p (page_entry *p) gcc_assert (p->num_free_objects < num_objects); } - -/* Decrement the `GC context'. All objects allocated since the - previous ggc_push_context are migrated to the outer context. */ - -void -ggc_pop_context (void) -{ - unsigned long omask; - unsigned int depth, i, e; -#ifdef ENABLE_CHECKING - unsigned int order; -#endif - - depth = --G.context_depth; - omask = (unsigned long)1 << (depth + 1); - - if (!((G.context_depth_allocations | G.context_depth_collections) & omask)) - return; - - G.context_depth_allocations |= (G.context_depth_allocations & omask) >> 1; - G.context_depth_allocations &= omask - 1; - G.context_depth_collections &= omask - 1; - - /* The G.depth array is shortened so that the last index is the - context_depth of the top element of by_depth. */ - if (depth+1 < G.depth_in_use) - e = G.depth[depth+1]; - else - e = G.by_depth_in_use; - - /* We might not have any PTEs of depth depth. */ - if (depth < G.depth_in_use) - { - - /* First we go through all the pages at depth depth to - recalculate the in use bits. */ - for (i = G.depth[depth]; i < e; ++i) - { - page_entry *p = G.by_depth[i]; - - /* Check that all of the pages really are at the depth that - we expect. */ - gcc_assert (p->context_depth == depth); - gcc_assert (p->index_by_depth == i); - - prefetch (&save_in_use_p_i (i+8)); - prefetch (&save_in_use_p_i (i+16)); - if (save_in_use_p_i (i)) - { - p = G.by_depth[i]; - ggc_recalculate_in_use_p (p); - free (save_in_use_p_i (i)); - save_in_use_p_i (i) = 0; - } - } - } - - /* Then, we reset all page_entries with a depth greater than depth - to be at depth. */ - for (i = e; i < G.by_depth_in_use; ++i) - { - page_entry *p = G.by_depth[i]; - - /* Check that all of the pages really are at the depth we - expect. */ - gcc_assert (p->context_depth > depth); - gcc_assert (p->index_by_depth == i); - p->context_depth = depth; - } - - adjust_depth (); - -#ifdef ENABLE_CHECKING - for (order = 2; order < NUM_ORDERS; order++) - { - page_entry *p; - - for (p = G.pages[order]; p != NULL; p = p->next) - gcc_assert (p->context_depth < depth || - (p->context_depth == depth && !save_in_use_p (p))); - } -#endif -} /* Unmark all objects. */ diff --git a/gcc/ggc.h b/gcc/ggc.h index a5ae6a2ec47..d6b2ea833b7 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -155,14 +155,6 @@ extern struct alloc_zone *new_ggc_zone (const char *); /* Free a complete GGC zone, destroying everything in it. */ extern void destroy_ggc_zone (struct alloc_zone *); -/* Start a new GGC context. Memory allocated in previous contexts - will not be collected while the new context is active. */ -extern void ggc_push_context (void); - -/* Finish a GC context. Any uncollected memory in the new context - will be merged with the old context. */ -extern void ggc_pop_context (void); - struct ggc_pch_data; /* Return a new ggc_pch_data structure. */ -- cgit v1.2.1