NFC: Introduce and switch to pal_zero

This wrapper will allow us to pass `AuthPtr<T,B> p` to zero() without needing to
write `p.unsafe_auth_ptr` to get to a `T*` inside.  Moreover, it will give us a
convenient point to assert that `B` is such that the pointer can be used to
manipulate the memory map (i.e. is not exported).
This commit is contained in:
Nathaniel Filardo
2021-04-01 00:07:21 +01:00
committed by Nathaniel Wesley Filardo
parent 4cfcf344fc
commit 7f841ff081
5 changed files with 18 additions and 7 deletions

View File

@@ -1026,7 +1026,8 @@ namespace snmalloc
void* p = remove_cache_friendly_offset(fl.take(entropy), sizeclass);
if constexpr (zero_mem == YesZero)
{
MemoryProvider::Pal::zero(p, sizeclass_to_size(sizeclass));
pal_zero<typename MemoryProvider::Pal>(
p, sizeclass_to_size(sizeclass));
}
return p;
}
@@ -1138,7 +1139,7 @@ namespace snmalloc
if constexpr (zero_mem == YesZero)
{
MemoryProvider::Pal::zero(p, sizeclass_to_size(sizeclass));
pal_zero<typename MemoryProvider::Pal>(p, sizeclass_to_size(sizeclass));
}
return p;
}