mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-29 09:54:35 +00:00
Merge pull request #197 from danielkrupinski/master
Use forwarding references with std::forward()
This commit is contained in:
commit
6bdc8e1bf8
@ -3616,7 +3616,7 @@ class VmaPoolAllocator
|
|||||||
public:
|
public:
|
||||||
VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity);
|
VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity);
|
||||||
~VmaPoolAllocator();
|
~VmaPoolAllocator();
|
||||||
template<typename... Types> T* Alloc(Types... args);
|
template<typename... Types> T* Alloc(Types&&... args);
|
||||||
void Free(T* ptr);
|
void Free(T* ptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -3658,7 +3658,7 @@ VmaPoolAllocator<T>::~VmaPoolAllocator()
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
template<typename... Types> T* VmaPoolAllocator<T>::Alloc(Types... args)
|
template<typename... Types> T* VmaPoolAllocator<T>::Alloc(Types&&... args)
|
||||||
{
|
{
|
||||||
for(size_t i = m_ItemBlocks.size(); i--; )
|
for(size_t i = m_ItemBlocks.size(); i--; )
|
||||||
{
|
{
|
||||||
@ -6272,7 +6272,7 @@ class VmaAllocationObjectAllocator
|
|||||||
public:
|
public:
|
||||||
VmaAllocationObjectAllocator(const VkAllocationCallbacks* pAllocationCallbacks);
|
VmaAllocationObjectAllocator(const VkAllocationCallbacks* pAllocationCallbacks);
|
||||||
|
|
||||||
template<typename... Types> VmaAllocation Allocate(Types... args);
|
template<typename... Types> VmaAllocation Allocate(Types&&... args);
|
||||||
void Free(VmaAllocation hAlloc);
|
void Free(VmaAllocation hAlloc);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -14160,7 +14160,7 @@ VmaAllocationObjectAllocator::VmaAllocationObjectAllocator(const VkAllocationCal
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename... Types> VmaAllocation VmaAllocationObjectAllocator::Allocate(Types... args)
|
template<typename... Types> VmaAllocation VmaAllocationObjectAllocator::Allocate(Types&&... args)
|
||||||
{
|
{
|
||||||
VmaMutexLock mutexLock(m_Mutex);
|
VmaMutexLock mutexLock(m_Mutex);
|
||||||
return m_Allocator.Alloc<Types...>(std::forward<Types>(args)...);
|
return m_Allocator.Alloc<Types...>(std::forward<Types>(args)...);
|
||||||
|
Loading…
Reference in New Issue
Block a user