aboutsummaryrefslogtreecommitdiff
path: root/libcpp/ChangeLog
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-10-17 10:00:07 +0000
committerDodji Seketeli <dodji@gcc.gnu.org>2011-10-17 12:00:07 +0200
commitb9bd6f743843a53de1396c43d1e308e51d40c5c4 (patch)
tree0b0e309c095d0459230339edc0343cafe8f0c4c8 /libcpp/ChangeLog
parent64a1a422dba4b0c09ad38310e32a223f2e16ed9d (diff)
downloadgcc-b9bd6f743843a53de1396c43d1e308e51d40c5c4.zip
gcc-b9bd6f743843a53de1396c43d1e308e51d40c5c4.tar.gz
gcc-b9bd6f743843a53de1396c43d1e308e51d40c5c4.tar.bz2
Reduce memory waste due to non-power-of-2 allocs
This patch basically arranges for the allocation size of line_map buffers to be as close as possible to a power of two. This *significantly* decreases peak memory consumption as (macro) maps are numerous and stay live during all the compilation. The patch adds a new ggc_round_alloc_size interface to the ggc allocator. In each of the two main allocator implementations ('page' and 'zone') the function has been extracted from the main allocation function code and returns the actual size of the allocated memory region, thus giving a chance to the caller to maximize the amount of memory it actually uses from the allocated memory region. In the 'none' allocator implementation (that uses xmalloc) the ggc_round_alloc_size just returns the requested allocation size. Co-Authored-By: Dodji Seketeli <dodji@redhat.com> From-SVN: r180086
Diffstat (limited to 'libcpp/ChangeLog')
-rw-r--r--libcpp/ChangeLog8
1 files changed, 8 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index fad0da6..3750720 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,6 +1,14 @@
2011-10-15 Tom Tromey <tromey@redhat.com>
Dodji Seketeli <dodji@redhat.com>
+ * include/line-map.h (struct line_maps::alloced_size_for_request):
+ New member.
+ * line-map.c (new_linemap): Use set->alloced_size_for_request to
+ get the actual allocated size of line maps.
+
+2011-10-15 Tom Tromey <tromey@redhat.com>
+ Dodji Seketeli <dodji@redhat.com>
+
* line-map.h (struct linemap_stats): Declare new struct.
(linemap_get_statistics): Declare ...
* line-map.c (linemap_get_statistics): ... new function.