Merge pull request #146 from microsoft/minor_bug_fixes

Minor bug fixes
This commit is contained in:
Matthew Parkinson
2020-03-18 15:01:26 +00:00
committed by GitHub
3 changed files with 9 additions and 6 deletions

View File

@@ -77,12 +77,15 @@ namespace snmalloc
tick.time_since_epoch())
.count());
}
else
{
#if __has_builtin(__builtin_readcyclecounter) && \
!defined(SNMALLOC_NO_AAL_BUILTINS)
return __builtin_readcyclecounter();
return __builtin_readcyclecounter();
#else
return Arch::tick();
return Arch::tick();
#endif
}
}
};

View File

@@ -1,6 +1,6 @@
#pragma once
#if defined(__arch64__)
#if defined(__aarch64__)
# define SNMALLOC_VA_BITS_64
#else
# define SNMALLOC_VA_BITS_32

View File

@@ -76,15 +76,15 @@ namespace snmalloc
SNMALLOC_ASSERT(
is_aligned_block<OS_PAGE_SIZE>(p, size) || (zero_mem == NoZero));
if constexpr (zero_mem == YesZero)
static_cast<OS*>(this)->template zero<true>(p, size);
#ifdef USE_POSIX_COMMIT_CHECKS
mprotect(p, size, PROT_READ | PROT_WRITE);
#else
UNUSED(p);
UNUSED(size);
#endif
if constexpr (zero_mem == YesZero)
static_cast<OS*>(this)->template zero<true>(p, size);
}
/**