[core/memory] Remove defered heap allocation on Linux. #2587

Open
Lizzie wants to merge 3 commits from bl-heaptrackfix-defer into master
Showing only changes of commit a0be40edf6 - Show all commits

View file

@ -8,6 +8,7 @@
#include "common/heap_tracker.h"
#include "common/logging/log.h"

Needed on line 108

Needed on line 108
#include "common/assert.h"
namespace Common {
@ -167,7 +168,7 @@ void HeapTracker::Protect(size_t virtual_offset, size_t size, MemoryPermission p
}
// Clamp to end.

Should be (std::min) cause aarch64, i think

Should be (std::min) cause aarch64, i think

what??

what??

I remember you did some changes related to putting () on std::min and std::max when enabling clang-cl (and I'm almost pretty sure it didn't generated a build of this PR)

I remember you did some changes related to putting () on std::min and std::max when enabling clang-cl (and I'm almost pretty sure it didn't generated a build of this PR)

clang-cl will murder you if you don't use parentheses

clang-cl will murder you if you don't use parentheses
next = std::min(next, end);
next = (std::min)(next, end);
// Reprotect, if we need to.
if (should_protect) {
@ -189,7 +190,7 @@ void HeapTracker::RebuildSeparateHeapAddressSpace() {
// Despite being worse in theory, this has proven to be better in practice than more
// regularly dumping a smaller amount, because it significantly reduces average case
// lock contention.

Same as previous

Same as previous
const size_t desired_count = std::min(m_resident_map_count, m_max_resident_map_count) / 2;
const size_t desired_count = (std::min)(m_resident_map_count, m_max_resident_map_count) / 2;
const size_t evict_count = m_resident_map_count - desired_count;
auto it = m_resident_mappings.begin();