summaryrefslogtreecommitdiffstats
path: root/runtime/gc/accounting/space_bitmap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/gc/accounting/space_bitmap.cc')
-rw-r--r--runtime/gc/accounting/space_bitmap.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/runtime/gc/accounting/space_bitmap.cc b/runtime/gc/accounting/space_bitmap.cc
index c294bae4a3..224b33e260 100644
--- a/runtime/gc/accounting/space_bitmap.cc
+++ b/runtime/gc/accounting/space_bitmap.cc
@@ -79,12 +79,8 @@ std::string SpaceBitmap<kAlignment>::Dump() const {
template<size_t kAlignment>
void SpaceBitmap<kAlignment>::Clear() {
- if (bitmap_begin_ != NULL) {
- // This returns the memory to the system. Successive page faults will return zeroed memory.
- int result = madvise(bitmap_begin_, bitmap_size_, MADV_DONTNEED);
- if (result == -1) {
- PLOG(FATAL) << "madvise failed";
- }
+ if (bitmap_begin_ != nullptr) {
+ mem_map_->MadviseDontNeedAndZero();
}
}