summaryrefslogtreecommitdiff
path: root/src/space.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/space.cc')
-rw-r--r--src/space.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/space.cc b/src/space.cc
index f0f93231cd..324b495ddc 100644
--- a/src/space.cc
+++ b/src/space.cc
@@ -319,7 +319,11 @@ size_t AllocSpace::AllocationSize(const Object* obj) {
return mspace_usable_size(const_cast<void*>(reinterpret_cast<const void*>(obj))) + kChunkOverhead;
}
-void MspaceMadviseCallback(void* start, void* end, void* /*arg*/) {
+void MspaceMadviseCallback(void* start, void* end, size_t used_bytes, void* /* arg */) {
+ // Is this chunk in use?
+ if (used_bytes != 0) {
+ return;
+ }
// Do we have any whole pages to give back?
start = reinterpret_cast<void*>(RoundUp(reinterpret_cast<uintptr_t>(start), kPageSize));
end = reinterpret_cast<void*>(RoundDown(reinterpret_cast<uintptr_t>(end), kPageSize));
@@ -329,14 +333,6 @@ void MspaceMadviseCallback(void* start, void* end, void* /*arg*/) {
}
}
-void MspaceMadviseCallback(void* start, void* end, size_t used_bytes, void* arg) {
- // Is this chunk in use?
- if (used_bytes != 0) {
- return;
- }
- return MspaceMadviseCallback(start, end, arg);
-}
-
void AllocSpace::Trim() {
MutexLock mu(lock_);
// Trim to release memory at the end of the space.