Mac M1 fix (#278)
The actual code works fine on the usual mac Intel however, some failures occurs with some unit tests on the ARM h/w when zero'ing page ranges.
This commit is contained in:
@@ -35,6 +35,21 @@ namespace snmalloc
|
||||
* descriptor for the mapping.
|
||||
*/
|
||||
static constexpr int anonymous_memory_fd = VM_MAKE_TAG(PALAnonID);
|
||||
|
||||
/**
|
||||
* Note: The root's implementation works fine on Intel
|
||||
* however mprotect/PROT_NONE fails on ARM
|
||||
* especially since the 11.2 release (seems known issue
|
||||
* spotted in various projects; might be a temporary fix).
|
||||
*/
|
||||
template<bool page_aligned = false>
|
||||
static void zero(void* p, size_t size) noexcept
|
||||
{
|
||||
if constexpr (Aal::aal_name != ARM)
|
||||
PALBSD::zero(p, size);
|
||||
else
|
||||
::bzero(p, size);
|
||||
}
|
||||
};
|
||||
} // namespace snmalloc
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user