From fe43f0bea8ef3c69c20018c51b914e372bf544dc Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Mon, 18 Oct 2021 22:03:31 +0100 Subject: [PATCH] Placate some compiler errors on CHERI --- src/backend/pagemap.h | 2 +- src/mem/metaslab.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend/pagemap.h b/src/backend/pagemap.h index 9c770f0..fe1f9e7 100644 --- a/src/backend/pagemap.h +++ b/src/backend/pagemap.h @@ -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) { diff --git a/src/mem/metaslab.h b/src/mem/metaslab.h index fcbb293..c68e95b 100644 --- a/src/mem/metaslab.h +++ b/src/mem/metaslab.h @@ -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(remote_and_sizeclass) & + (alignof(RemoteAllocator) - 1); } };