diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-11-19 10:41:46 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-12-20 15:35:58 +0100 |
commit | 3bddc19f5854857788330f11993336f645c414ab (patch) | |
tree | 80f9233bb3b1420df0113887089b691f4b40c600 /asl/allocator.cpp | |
parent | d241eaf1b209dcfb05656842dd6250067b704d99 (diff) |
Fix Linux build
Diffstat (limited to 'asl/allocator.cpp')
-rw-r--r-- | asl/allocator.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/asl/allocator.cpp b/asl/allocator.cpp index 9559637..f50b42b 100644 --- a/asl/allocator.cpp +++ b/asl/allocator.cpp @@ -11,9 +11,15 @@ void* asl::GlobalHeap::alloc(const layout& layout)
{
+#if ASL_OS_WINDOWS
void* ptr = ::_aligned_malloc(
static_cast<size_t>(layout.size),
static_cast<size_t>(layout.align));
+#elif ASL_OS_LINUX
+ void* ptr = ::aligned_alloc(
+ static_cast<size_t>(layout.size),
+ static_cast<size_t>(layout.align));
+#endif
ASL_ASSERT(ptr != nullptr); // @Todo panic
return ptr;
}
|