Placate some compiler errors on CHERI

This commit is contained in:
Nathaniel Wesley Filardo
2021-10-18 22:03:31 +01:00
committed by Nathaniel Wesley Filardo
parent fa4560801a
commit fe43f0bea8
2 changed files with 5 additions and 2 deletions

View File

@@ -294,7 +294,7 @@ namespace snmalloc
void set(address_t p, T t)
{
#ifdef SNMALLOC_TRACING
std::cout << "Pagemap.Set " << (void*)p << std::endl;
std::cout << "Pagemap.Set " << (void*)(uintptr_t)p << std::endl;
#endif
if constexpr (has_bounds)
{

View File

@@ -283,7 +283,10 @@ namespace snmalloc
[[nodiscard]] SNMALLOC_FAST_PATH sizeclass_t get_sizeclass() const
{
return remote_and_sizeclass & (alignof(RemoteAllocator) - 1);
// TODO: perhaps remove static_cast with resolution of
// https://github.com/CTSRD-CHERI/llvm-project/issues/588
return static_cast<sizeclass_t>(remote_and_sizeclass) &
(alignof(RemoteAllocator) - 1);
}
};