diff options
| author | azhirnov <zh1dron@gmail.com> | 2020-10-17 17:02:58 +0000 |
|---|---|---|
| committer | azhirnov <zh1dron@gmail.com> | 2020-10-17 17:02:58 +0000 |
| commit | e8f439dc0f87f6820e3db53ecd8ee41cc878d90c (patch) | |
| tree | 65e6bbc267b04c7de10f9b3bec3ed5ca42b033df /Common/interface | |
| parent | Added test for LinearAllocator (diff) | |
| download | DiligentCore-e8f439dc0f87f6820e3db53ecd8ee41cc878d90c.tar.gz DiligentCore-e8f439dc0f87f6820e3db53ecd8ee41cc878d90c.zip | |
Fixed compilation, some fixes after review
Diffstat (limited to 'Common/interface')
| -rw-r--r-- | Common/interface/LinearAllocator.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Common/interface/LinearAllocator.hpp b/Common/interface/LinearAllocator.hpp index 9d580f0b..00f94ee3 100644 --- a/Common/interface/LinearAllocator.hpp +++ b/Common/interface/LinearAllocator.hpp @@ -98,10 +98,11 @@ public: VERIFY(m_pBuffer == nullptr, "Memory already allocated"); if (size > 0) { + size = Align(size, align); m_RequiredSize = Align(m_RequiredSize, align) + size; // Reserve additional space for pointer alignment - m_RequiredSize += (align > sizeof(void*) ? align : 0); + m_RequiredSize += (align > sizeof(void*) ? align - sizeof(void*) : 0); } } |
