From d46bbdd19b807cff0b59dfbc0b26ebc0d27456f5 Mon Sep 17 00:00:00 2001 From: Daniel Schemmel Date: Fri, 19 May 2023 22:27:25 +0000 Subject: Add `getMapping` primitive to allocator directly --- include/klee/KDAlloc/allocator.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/klee/KDAlloc/allocator.h b/include/klee/KDAlloc/allocator.h index 2d8a07ac..45d90536 100644 --- a/include/klee/KDAlloc/allocator.h +++ b/include/klee/KDAlloc/allocator.h @@ -117,6 +117,16 @@ public: explicit operator bool() const noexcept { return !control.isNull(); } + Mapping &getMapping() noexcept { + assert(!!*this && "Cannot get mapping of uninitialized allocator."); + return control->mapping; + } + + Mapping const &getMapping() const noexcept { + assert(!!*this && "Cannot get mapping of uninitialized allocator."); + return control->mapping; + } + [[nodiscard]] void *allocate(std::size_t size) { assert(*this && "Invalid allocator"); -- cgit 1.4.1