Skip to content

Commit b61cbda

Browse files
committed
fix(command buffer) : replace _aligned_malloc with malloc.
1 parent f004e54 commit b61cbda

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/bump_allocator.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ namespace ECS
7373
*/
7474

7575
//FOR MVP
76-
m_allocatedBlocks.push_back(_aligned_malloc(size, alignment));
76+
//m_allocatedBlocks.push_back(_aligned_malloc(size, alignment));
77+
void* ptr = malloc(size);
78+
79+
assert(ptr != nullptr);
80+
assert((reinterpret_cast<std::uintptr_t>(ptr) % alignment) == 0);
81+
82+
m_allocatedBlocks.push_back(ptr);
7783
return m_allocatedBlocks.back();
7884
}
7985

@@ -83,7 +89,9 @@ namespace ECS
8389

8490
for (auto& ptr : m_allocatedBlocks)
8591
{
86-
_aligned_free(ptr);
92+
//_aligned_free(ptr);
93+
free(ptr);
94+
8795
}
8896
m_allocatedBlocks.resize(0);//very important
8997
}

0 commit comments

Comments
 (0)