From 3395a56bd31d9d077bc2e9a2f84f450721f348dc Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Fri, 16 Feb 2024 18:38:12 -0500 Subject: [PATCH] more allocators --- include/blt/std/allocator.h | 10 +++++----- libraries/parallel-hashmap | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/blt/std/allocator.h b/include/blt/std/allocator.h index 38ffe47..e52c92e 100644 --- a/include/blt/std/allocator.h +++ b/include/blt/std/allocator.h @@ -61,7 +61,7 @@ namespace blt }; template - class area_allocator + class area_allocator : public allocator_base { public: using value = T; @@ -274,7 +274,7 @@ namespace blt }; template - class bump_allocator + class bump_allocator : public allocator_base { public: using value = T; @@ -300,17 +300,17 @@ namespace blt blt::size_t offset_; blt::size_t size_; public: - explicit bump_allocator(blt::size_t size): buffer_(malloc(size * sizeof(T))), size_(size), offset_(0) + explicit bump_allocator(blt::size_t size): buffer_(static_cast(malloc(size * sizeof(T)))), offset_(0), size_(size) {} template - explicit bump_allocator(blt::size_t size, Args&& ... defaults): buffer_(malloc(size * sizeof(type))), size_(size), offset_(0) + explicit bump_allocator(blt::size_t size, Args&& ... defaults): buffer_(static_cast(malloc(size * sizeof(type)))), offset_(0), size_(size) { for (blt::size_t i = 0; i < size_; i++) ::new(&buffer_[i]) T(std::forward(defaults)...); } - bump_allocator(pointer buffer, blt::size_t size): buffer_(buffer), size_(size), offset_(0) + bump_allocator(pointer buffer, blt::size_t size): buffer_(buffer), offset_(0), size_(size) {} bump_allocator(const bump_allocator& copy) = delete; diff --git a/libraries/parallel-hashmap b/libraries/parallel-hashmap index 67c2461..65775fa 160000 --- a/libraries/parallel-hashmap +++ b/libraries/parallel-hashmap @@ -1 +1 @@ -Subproject commit 67c24619e4f5ab2097b74cc397732c17a25d6944 +Subproject commit 65775fa09fecaa65d0b0022ab6bf091c0e509445