/* "Bag-of-pages" zone garbage collector for the GNU compiler.
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@redhat.com) and Daniel Berlin
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
#include "config.h"
#include "system.h"
ggc_set_mark for any object in the garbage zone, which cuts off
marking quickly. */
-/* Stategy:
+/* Strategy:
This garbage-collecting allocator segregates objects into zones.
It also segregates objects into "large" and "small" bins. Large
}
/* Set the allocation bit corresponding to OBJECT in its page's
- bitmap. Used to split this object from the preceeding one. */
+ bitmap. Used to split this object from the preceding one. */
static inline void
zone_set_object_alloc_bit (const void *object)
{
}
/* Clear the allocation bit corresponding to OBJECT in PAGE's
- bitmap. Used to coalesce this object with the preceeding
+ bitmap. Used to coalesce this object with the preceding
one. */
static inline void
zone_clear_object_alloc_bit (struct small_page_entry *page,
/* Keep track of how many bytes are being allocated. This
information is used in deciding when to collect. */
zone->allocated += size;
+
+ timevar_ggc_mem_total += size;
#ifdef GATHER_STATISTICS
ggc_record_overhead (orig_size, size - orig_size, result PASS_MEM_STAT);
switch (gte)
{
case gt_ggc_e_14lang_tree_node:
- return ggc_alloc_zone_stat (size, &tree_zone PASS_MEM_STAT);
+ return ggc_alloc_zone_pass_stat (size, &tree_zone);
case gt_ggc_e_7rtx_def:
- return ggc_alloc_zone_stat (size, &rtl_zone PASS_MEM_STAT);
+ return ggc_alloc_zone_pass_stat (size, &rtl_zone);
case gt_ggc_e_9rtvec_def:
- return ggc_alloc_zone_stat (size, &rtl_zone PASS_MEM_STAT);
+ return ggc_alloc_zone_pass_stat (size, &rtl_zone);
default:
- return ggc_alloc_zone_stat (size, &main_zone PASS_MEM_STAT);
+ return ggc_alloc_zone_pass_stat (size, &main_zone);
}
}
void *
ggc_alloc_stat (size_t size MEM_STAT_DECL)
{
- return ggc_alloc_zone_stat (size, &main_zone PASS_MEM_STAT);
+ return ggc_alloc_zone_pass_stat (size, &main_zone);
}
/* Poison the chunk. */
pte_overhead += PAGE_L2_SIZE * sizeof (struct page_entry *);
#else
{
- struct page_table_chain *table;
+ page_table table = G.lookup;
pte_overhead = 0;
while (table)
{