about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorDaniel Schemmel <daniel@schemmel.net>2023-05-19 22:27:25 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-05-26 21:01:54 +0100
commitd46bbdd19b807cff0b59dfbc0b26ebc0d27456f5 (patch)
tree764523edc040802bcc97563713fd1c0b65ade271
parentedda465c2e752eed164c2e2119a1b4ac00efbfd9 (diff)
downloadklee-d46bbdd19b807cff0b59dfbc0b26ebc0d27456f5.tar.gz
Add `getMapping` primitive to allocator directly
-rw-r--r--include/klee/KDAlloc/allocator.h10
1 files changed, 10 insertions, 0 deletions
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");