summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralkondratenko@gmail.com <alkondratenko@gmail.com@6b5cf1ce-ec42-a296-1ba9-69fdba395a50>2013-07-26 18:19:05 +0000
committeralkondratenko@gmail.com <alkondratenko@gmail.com@6b5cf1ce-ec42-a296-1ba9-69fdba395a50>2013-07-26 18:19:05 +0000
commite3716145cbfa1247fa37dd627b2136a061944255 (patch)
treeca52069f17f2f0416a6547913fce4ec38e630172
parentf45133e75c09ca7d5e86bda2db16e30c6fa348c0 (diff)
downloadgperftools-e3716145cbfa1247fa37dd627b2136a061944255.tar.gz
issue-552: Fix page_heap_test for system with different page size
This is patch by Adhemerval Zanella. PowerPC uses 64K page size instead of 4k for x86 and x86_64. It makes the page_heap_test fails because the following test: static bool HaveSystemRelease = TCMalloc_SystemRelease(TCMalloc_SystemAlloc(kPageSize, NULL, 0), kPageSize); will always fail if kPageSize is less than getpagesize() (the default configuration). The following patch fixes it by trying to allocate/deallocate an entire page instead. git-svn-id: http://gperftools.googlecode.com/svn/trunk@228 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
-rw-r--r--src/tests/page_heap_test.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tests/page_heap_test.cc b/src/tests/page_heap_test.cc
index 5bd803d..817b69b 100644
--- a/src/tests/page_heap_test.cc
+++ b/src/tests/page_heap_test.cc
@@ -12,8 +12,11 @@ DECLARE_int64(tcmalloc_heap_limit_mb);
namespace {
+// The system will only release memory if the block size is equal or hight than
+// system page size.
static bool HaveSystemRelease =
- TCMalloc_SystemRelease(TCMalloc_SystemAlloc(kPageSize, NULL, 0), kPageSize);
+ TCMalloc_SystemRelease(
+ TCMalloc_SystemAlloc(getpagesize(), NULL, 0), getpagesize());
static void CheckStats(const tcmalloc::PageHeap* ph,
uint64_t system_pages,