From c8a2a557db90c9d9b058db36cb09cee0a6c96cfd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 21 Sep 2017 21:52:08 +0200 Subject: [PATCH] util/HugeAllocator: remove obsolete class HugeAllocation --- src/util/HugeAllocator.hxx | 45 -------------------------------------- 1 file changed, 45 deletions(-) diff --git a/src/util/HugeAllocator.hxx b/src/util/HugeAllocator.hxx index b87e502af..b838f3862 100644 --- a/src/util/HugeAllocator.hxx +++ b/src/util/HugeAllocator.hxx @@ -132,51 +132,6 @@ HugeDiscard(void *, size_t) noexcept #endif -/** - * Automatic huge memory allocation management. - */ -class HugeAllocation { - WritableBuffer buffer = nullptr; - -public: - HugeAllocation() = default; - - explicit HugeAllocation(size_t _size) - :buffer(HugeAllocate(_size)) {} - - HugeAllocation(HugeAllocation &&src) noexcept - :buffer(std::exchange(src.buffer, nullptr)) {} - - ~HugeAllocation() { - if (buffer != nullptr) - HugeFree(buffer.data, buffer.size); - } - - HugeAllocation &operator=(HugeAllocation &&src) noexcept { - std::swap(buffer, src.buffer); - return *this; - } - - void ForkCow(bool enable) noexcept { - HugeForkCow(buffer.data, buffer.size, enable); - } - - void Discard() noexcept { - HugeDiscard(buffer.data, buffer.size); - } - - void reset() noexcept { - if (buffer != nullptr) { - HugeFree(buffer.data, buffer.size); - buffer = nullptr; - } - } - - void *get() noexcept { - return buffer.data; - } -}; - /** * Automatic memory management for a dynamic array in "huge" memory. */