|
1 | 1 | diff --git a/include/svs/lib/memory.h b/include/svs/lib/memory.h
|
2 |
| -index c79fff1..dcc015b 100644 |
| 2 | +index c79fff1..7f55390 100644 |
3 | 3 | --- a/include/svs/lib/memory.h
|
4 | 4 | +++ b/include/svs/lib/memory.h
|
5 | 5 | @@ -61,7 +61,7 @@ template <typename T> struct Allocator {
|
6 | 6 | }
|
7 | 7 |
|
8 | 8 | constexpr void deallocate(value_type* ptr, size_t count) noexcept {
|
9 | 9 | - ::operator delete(ptr, count);
|
10 |
| -+ ::operator delete(ptr, count, std::align_val_t(alignof(T))); |
| 10 | ++ ::operator delete(static_cast<void*>(ptr), sizeof(T) * count, std::align_val_t(alignof(T))); |
11 | 11 | }
|
12 | 12 |
|
13 | 13 | // Intercept zero-argument construction to do default initialization.
|
| 14 | +diff --git a/include/svs/lib/threads/threadlocal.h b/include/svs/lib/threads/threadlocal.h |
| 15 | +index f6d399f..5fdebd2 100644 |
| 16 | +--- a/include/svs/lib/threads/threadlocal.h |
| 17 | ++++ b/include/svs/lib/threads/threadlocal.h |
| 18 | +@@ -82,7 +82,8 @@ template <typename T, size_t Alignment = CACHE_LINE_BYTES> struct AlignedAllocat |
| 19 | + } |
| 20 | + |
| 21 | + void deallocate(value_type* ptr, size_t count) noexcept { |
| 22 | +- ::operator delete(ptr, count, std::align_val_t{alignment}); |
| 23 | ++ size_t bytes = alignment * lib::div_round_up(sizeof(T) * count, alignment); |
| 24 | ++ ::operator delete(static_cast<void*>(ptr), bytes, std::align_val_t{alignment}); |
| 25 | + } |
| 26 | + }; |
| 27 | + |
0 commit comments