diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-10-09 10:40:57 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-10-09 10:40:57 -0400 |
| commit | 96ea43e609e59a166fd6fe65511db3fe9fe777e9 (patch) | |
| tree | a1b03c77dfc51e3200c9006f52f33323cc559fd9 /src/memory.hpp | |
| parent | 5a7d0e4f91736aa3794c0fd94741565ba96babec (diff) | |
bucket teardown
Diffstat (limited to 'src/memory.hpp')
| -rw-r--r-- | src/memory.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/memory.hpp b/src/memory.hpp index 6d431fc..50be56b 100644 --- a/src/memory.hpp +++ b/src/memory.hpp @@ -98,4 +98,11 @@ static inline constexpr uint64_t Buckets_GetItemIndex(uint64_t handle) { return handle >> 32; } +template <typename T, typename CT> +static inline constexpr void Buckets_Destroy(BucketContainer<T, CT> &bktContainer) { + if (bktContainer.buckets == nullptr || bktContainer.buckets == CAFE_BABE(T)) return; + Pke_Delete<T>(bktContainer.buckets, bktContainer.bucketCounter); + bktContainer.buckets = CAFE_BABE(T); +} + #endif /* PKE_MEMORY_HPP */ |
