diff options
author | Daniel Schemmel <daniel@schemmel.net> | 2023-05-19 22:27:25 +0000 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2023-05-26 21:01:54 +0100 |
commit | d46bbdd19b807cff0b59dfbc0b26ebc0d27456f5 (patch) | |
tree | 764523edc040802bcc97563713fd1c0b65ade271 /include | |
parent | edda465c2e752eed164c2e2119a1b4ac00efbfd9 (diff) | |
download | klee-d46bbdd19b807cff0b59dfbc0b26ebc0d27456f5.tar.gz |
Add `getMapping` primitive to allocator directly
Diffstat (limited to 'include')
-rw-r--r-- | include/klee/KDAlloc/allocator.h | 10 |
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"); |