Commit e4dfaf72 by Laurynas Biveinis Committed by Laurynas Biveinis

ggc-zone.c: Update copyright year.

2010-05-26  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* ggc-zone.c: Update copyright year.
	(poison_region): Mark memory for Valgrind as undefined before
	memset () call and inaccessible afterwards.
	(ggc_pch_total_size): Change type of i to int.

2010-05-26  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* ggc-common.c (ggc_free_overhead): Allow empty slot.

2010-05-26  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	* ggc-common.c: Update copyright year.
	(ggc_rlimit_bound): Remove prototype.  Compile only if
	!ENABLE_GC_CHECKING && !ENABLE_GC_ALWAYS_COLLECT.
	(ggc_min_heapsize_heuristic): Compile only if !ENABLE_GC_CHECKING
	&& !ENABLE_GC_ALWAYS_COLLECT.  Make static.
	(ggc_min_heapsize_heuristic): Likewise.

From-SVN: r159863
parent e12da9c2
2010-05-26 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* ggc-zone.c: Update copyright year.
(poison_region): Mark memory for Valgrind as undefined before
memset () call and inaccessible afterwards.
(ggc_pch_total_size): Change type of i to int.
2010-05-26 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* ggc-common.c (ggc_free_overhead): Allow empty slot.
2010-05-26 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* ggc-common.c: Update copyright year.
(ggc_rlimit_bound): Remove prototype. Compile only if
!ENABLE_GC_CHECKING && !ENABLE_GC_ALWAYS_COLLECT.
(ggc_min_heapsize_heuristic): Compile only if !ENABLE_GC_CHECKING
&& !ENABLE_GC_ALWAYS_COLLECT. Make static.
(ggc_min_heapsize_heuristic): Likewise.
2010-05-26 Richard Guenther <rguenther@suse.de> 2010-05-26 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/44164 PR rtl-optimization/44164
......
/* Simple garbage collection for the GNU compiler. /* Simple garbage collection for the GNU compiler.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
Free Software Foundation, Inc. 2009, 2010 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -70,7 +70,6 @@ static int compare_ptr_data (const void *, const void *); ...@@ -70,7 +70,6 @@ static int compare_ptr_data (const void *, const void *);
static void relocate_ptrs (void *, void *); static void relocate_ptrs (void *, void *);
static void write_pch_globals (const struct ggc_root_tab * const *tab, static void write_pch_globals (const struct ggc_root_tab * const *tab,
struct traversal_state *state); struct traversal_state *state);
static double ggc_rlimit_bound (double);
/* Maintain global roots that are preserved during GC. */ /* Maintain global roots that are preserved during GC. */
...@@ -742,6 +741,8 @@ mmap_gt_pch_use_address (void *base, size_t size, int fd, size_t offset) ...@@ -742,6 +741,8 @@ mmap_gt_pch_use_address (void *base, size_t size, int fd, size_t offset)
} }
#endif /* HAVE_MMAP_FILE */ #endif /* HAVE_MMAP_FILE */
#if !defined ENABLE_GC_CHECKING && !defined ENABLE_GC_ALWAYS_COLLECT
/* Modify the bound based on rlimits. */ /* Modify the bound based on rlimits. */
static double static double
ggc_rlimit_bound (double limit) ggc_rlimit_bound (double limit)
...@@ -776,7 +777,7 @@ ggc_rlimit_bound (double limit) ...@@ -776,7 +777,7 @@ ggc_rlimit_bound (double limit)
} }
/* Heuristic to set a default for GGC_MIN_EXPAND. */ /* Heuristic to set a default for GGC_MIN_EXPAND. */
int static int
ggc_min_expand_heuristic (void) ggc_min_expand_heuristic (void)
{ {
double min_expand = physmem_total(); double min_expand = physmem_total();
...@@ -795,7 +796,7 @@ ggc_min_expand_heuristic (void) ...@@ -795,7 +796,7 @@ ggc_min_expand_heuristic (void)
} }
/* Heuristic to set a default for GGC_MIN_HEAPSIZE. */ /* Heuristic to set a default for GGC_MIN_HEAPSIZE. */
int static int
ggc_min_heapsize_heuristic (void) ggc_min_heapsize_heuristic (void)
{ {
double phys_kbytes = physmem_total(); double phys_kbytes = physmem_total();
...@@ -832,6 +833,7 @@ ggc_min_heapsize_heuristic (void) ...@@ -832,6 +833,7 @@ ggc_min_heapsize_heuristic (void)
return phys_kbytes; return phys_kbytes;
} }
#endif
void void
init_ggc_heuristics (void) init_ggc_heuristics (void)
...@@ -980,7 +982,13 @@ ggc_free_overhead (void *ptr) ...@@ -980,7 +982,13 @@ ggc_free_overhead (void *ptr)
{ {
PTR *slot = htab_find_slot_with_hash (ptr_hash, ptr, htab_hash_pointer (ptr), PTR *slot = htab_find_slot_with_hash (ptr_hash, ptr, htab_hash_pointer (ptr),
NO_INSERT); NO_INSERT);
struct ptr_hash_entry *p = (struct ptr_hash_entry *) *slot; struct ptr_hash_entry *p;
/* The pointer might be not found if a PCH read happened between allocation
and ggc_free () call. FIXME: account memory properly in the presence of
PCH. */
if (!slot)
return;
p = (struct ptr_hash_entry *) *slot;
p->loc->freed += p->size; p->loc->freed += p->size;
htab_clear_slot (ptr_hash, slot); htab_clear_slot (ptr_hash, slot);
free (p); free (p);
......
/* "Bag-of-pages" zone garbage collector for the GNU compiler. /* "Bag-of-pages" zone garbage collector for the GNU compiler.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
Free Software Foundation, Inc. 2010 Free Software Foundation, Inc.
Contributed by Richard Henderson (rth@redhat.com) and Daniel Berlin Contributed by Richard Henderson (rth@redhat.com) and Daniel Berlin
(dberlin@dberlin.org). Rewritten by Daniel Jacobowitz (dberlin@dberlin.org). Rewritten by Daniel Jacobowitz
...@@ -1386,7 +1386,11 @@ ggc_alloc_stat (size_t size MEM_STAT_DECL) ...@@ -1386,7 +1386,11 @@ ggc_alloc_stat (size_t size MEM_STAT_DECL)
/* Poison the chunk. */ /* Poison the chunk. */
#ifdef ENABLE_GC_CHECKING #ifdef ENABLE_GC_CHECKING
#define poison_region(PTR, SIZE) \ #define poison_region(PTR, SIZE) \
memset ((PTR), 0xa5, (SIZE)) do { \
VALGRIND_DISCARD (VALGRIND_MAKE_MEM_UNDEFINED ((PTR), (SIZE))); \
memset ((PTR), 0xa5, (SIZE)); \
VALGRIND_DISCARD (VALGRIND_MAKE_MEM_NOACCESS ((PTR), (SIZE))); \
} while (0)
#else #else
#define poison_region(PTR, SIZE) #define poison_region(PTR, SIZE)
#endif #endif
...@@ -2349,7 +2353,7 @@ ggc_pch_count_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED, ...@@ -2349,7 +2353,7 @@ ggc_pch_count_object (struct ggc_pch_data *d, void *x ATTRIBUTE_UNUSED,
size_t size_t
ggc_pch_total_size (struct ggc_pch_data *d) ggc_pch_total_size (struct ggc_pch_data *d)
{ {
enum gt_types_enum i; int i;
size_t alloc_size, total_size; size_t alloc_size, total_size;
total_size = 0; total_size = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment