diff options
author | ak <ak@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-29 01:01:34 +0000 |
---|---|---|
committer | ak <ak@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-29 01:01:34 +0000 |
commit | 76f0411d965454c0b994b5d5c0728771e04b3c35 (patch) | |
tree | 68feb3c0af7c2a57c894bfbcfdcd0d088cc63d89 /gcc/ggc-page.c | |
parent | aa0b463791ef064b269a7f2e3be46953941b5525 (diff) | |
download | gcc-76f0411d965454c0b994b5d5c0728771e04b3c35.tar.gz |
Add missing page rounding of a page_entry
This one place in ggc forgot to round page_entry->bytes to the
next page boundary, which lead to all the heuristics in freeing to
check for continuous memory failing. Round here too, like all other
allocators already do. The memory consumed should be the same
for MMAP because the kernel would round anyways. It may slightly
increase memory usage when malloc groups are used.
This will also increase the hitrate on the free page list
slightly.
gcc/:
2011-10-18 Andi Kleen <ak@linux.intel.com>
* ggc-page.c (alloc_pages): Always round up to entry_size.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180647 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ggc-page.c')
-rw-r--r-- | gcc/ggc-page.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index 617a49348d7..077bc8e2bee 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -737,6 +737,7 @@ alloc_page (unsigned order) entry_size = num_objects * OBJECT_SIZE (order); if (entry_size < G.pagesize) entry_size = G.pagesize; + entry_size = ROUND_UP (entry_size, G.pagesize); entry = NULL; page = NULL; |