Merge pull request #18 from danielkrupinski/master
Do not define empty non-virtual destructors
diff --git a/src/D3D12MemAlloc.cpp b/src/D3D12MemAlloc.cpp
index b6efe6b..15a91f6 100644
--- a/src/D3D12MemAlloc.cpp
+++ b/src/D3D12MemAlloc.cpp
@@ -1553,7 +1553,11 @@
// allocationCallbacks externally owned, must outlive this object.
List(const ALLOCATION_CALLBACKS& allocationCallbacks);
- ~List();
+
+ // 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; }
@@ -1777,13 +1781,6 @@
}
template<typename T>
-List<T>::~List()
-{
- // Intentionally not calling Clear, because that would be unnecessary
- // computations to return all items to m_ItemAllocator as free.
-}
-
-template<typename T>
void List<T>::Clear()
{
if(!IsEmpty())
@@ -6002,11 +5999,6 @@
m_PackedData.SetWasZeroInitialized(wasZeroInitialized);
}
-Allocation::~Allocation()
-{
- // Nothing here, everything already done in Release.
-}
-
void Allocation::InitCommitted(CommittedAllocationList* list)
{
m_PackedData.SetType(TYPE_COMMITTED);
@@ -6311,7 +6303,6 @@
BlockMetadata_Generic m_Metadata;
VirtualBlockPimpl(const ALLOCATION_CALLBACKS& allocationCallbacks, UINT64 size);
- ~VirtualBlockPimpl();
};
VirtualBlockPimpl::VirtualBlockPimpl(const ALLOCATION_CALLBACKS& allocationCallbacks, UINT64 size) :
@@ -6323,10 +6314,6 @@
m_Metadata.Init(m_Size);
}
-VirtualBlockPimpl::~VirtualBlockPimpl()
-{
-}
-
////////////////////////////////////////////////////////////////////////////////
// Public class VirtualBlock implementation
diff --git a/src/D3D12MemAlloc.h b/src/D3D12MemAlloc.h
index 8fc4d49..61a49b8 100644
--- a/src/D3D12MemAlloc.h
+++ b/src/D3D12MemAlloc.h
@@ -401,7 +401,9 @@
} m_PackedData;
Allocation(AllocatorPimpl* allocator, UINT64 size, BOOL wasZeroInitialized);
- ~Allocation();
+ // 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);