From 48521a1f8eb2110d7f341ea01b37cd701cde003f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Krupi=C5=84ski?= Date: Thu, 16 Sep 2021 19:21:19 +0200 Subject: [PATCH] Preserve comments explaining empty destructors --- src/D3D12MemAlloc.cpp | 5 +++++ src/D3D12MemAlloc.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/D3D12MemAlloc.cpp b/src/D3D12MemAlloc.cpp index 5020e00..15a91f6 100644 --- a/src/D3D12MemAlloc.cpp +++ b/src/D3D12MemAlloc.cpp @@ -1553,6 +1553,11 @@ public: // allocationCallbacks externally owned, must outlive this object. List(const ALLOCATION_CALLBACKS& allocationCallbacks); + + // Intentionally not calling Clear, because that would be unnecessary + // computations to return all items to m_ItemAllocator as free. + // ~List() {} + void Clear(); size_t GetCount() const { return m_Count; } diff --git a/src/D3D12MemAlloc.h b/src/D3D12MemAlloc.h index b326271..61a49b8 100644 --- a/src/D3D12MemAlloc.h +++ b/src/D3D12MemAlloc.h @@ -401,6 +401,9 @@ private: } m_PackedData; Allocation(AllocatorPimpl* allocator, UINT64 size, BOOL wasZeroInitialized); + // Nothing here, everything already done in Release. + // ~Allocation() {} + void InitCommitted(CommittedAllocationList* list); void InitPlaced(UINT64 offset, UINT64 alignment, NormalBlock* block); void InitHeap(CommittedAllocationList* list, ID3D12Heap* heap);