From adfca64fdbcfd75d42b7a069d27ddbb0228e9eff Mon Sep 17 00:00:00 2001 From: Julian Büning Date: Sat, 1 Apr 2023 13:22:38 +0200 Subject: change some obsolete KDAlloc comments - mappings were only shared in a former version of KDAlloc - `AllocationFactory(std::size_t, std::uint32_t)`'s second parameter is used for quarantine size, not the location of the mapping --- include/klee/KDAlloc/allocator.h | 3 ++- unittests/KDAlloc/allocate.cpp | 3 +-- unittests/KDAlloc/rusage.cpp | 6 ++---- unittests/KDAlloc/sample.cpp | 3 +-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/klee/KDAlloc/allocator.h b/include/klee/KDAlloc/allocator.h index f59223ed..c4461b79 100644 --- a/include/klee/KDAlloc/allocator.h +++ b/include/klee/KDAlloc/allocator.h @@ -29,7 +29,8 @@ #include namespace klee::kdalloc { -/// Wraps a mapping that is shared with other allocators. +/// Wraps a mapping and delegates allocation to one of 8 sized-bin slot +/// allocators (size < 4096) or a large object allocator (size >= 4096). class Allocator final : public TaggedLogger { public: class Control final { diff --git a/unittests/KDAlloc/allocate.cpp b/unittests/KDAlloc/allocate.cpp index 895f8215..c691e114 100644 --- a/unittests/KDAlloc/allocate.cpp +++ b/unittests/KDAlloc/allocate.cpp @@ -23,8 +23,7 @@ int allocate_sample_test() { #else int main() { #endif - // initialize a factory and an associated allocator (using the location "0" - // gives an OS-assigned location) + // initialize a factory and an associated allocator (1 MiB and no quarantine) klee::kdalloc::AllocatorFactory factory(static_cast(1) << 20, 0); klee::kdalloc::Allocator allocator = factory.makeAllocator(); diff --git a/unittests/KDAlloc/rusage.cpp b/unittests/KDAlloc/rusage.cpp index 453c5e5d..2a893d7d 100644 --- a/unittests/KDAlloc/rusage.cpp +++ b/unittests/KDAlloc/rusage.cpp @@ -35,10 +35,8 @@ std::size_t write_to_allocations(std::vector &allocations) { } TEST(KDAllocTest, Rusage) { - // initialize a factory and an associated allocator (using the location "0" - // gives an OS-assigned location) - klee::kdalloc::AllocatorFactory factory(static_cast(1) << 30, - 0); // 1 GB + // initialize a factory and an associated allocator (1 GiB and no quarantine) + klee::kdalloc::AllocatorFactory factory(static_cast(1) << 30, 0); klee::kdalloc::Allocator allocator = factory.makeAllocator(); std::vector allocations; diff --git a/unittests/KDAlloc/sample.cpp b/unittests/KDAlloc/sample.cpp index d4bed00b..365e7e21 100644 --- a/unittests/KDAlloc/sample.cpp +++ b/unittests/KDAlloc/sample.cpp @@ -20,8 +20,7 @@ int sample_test() { #else int main() { #endif - // initialize a factory and an associated allocator (using the location "0" - // gives an OS-assigned location) + // initialize a factory and an associated allocator (1 TiB and no quarantine) klee::kdalloc::AllocatorFactory factory(static_cast(1) << 40, 0); klee::kdalloc::Allocator allocator = factory.makeAllocator(); -- cgit 1.4.1