diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-01 22:07:29 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-01 22:07:29 +0100 |
| commit | 1dea700d4f6f3b35b80cb4230671e4ece0d7b144 (patch) | |
| tree | 35e8fab968ec5bf0a9e10d03534285dbda4fb134 | |
| parent | ffa09db5138dea853c910a0307fe5063511abb9f (diff) | |
fix aligned_alloc call and strlen
| -rw-r--r-- | src/memory.cc | 2 | ||||
| -rw-r--r-- | src/voidc.cc | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/memory.cc b/src/memory.cc index 27504f0..c27c6f3 100644 --- a/src/memory.cc +++ b/src/memory.cc @@ -24,7 +24,7 @@ void deallocate(Allocator* allocator, u8* ptr) { static inline u8* heap_allocate(u8* self, usize size, usize align) { (void)self; - return (u8*)aligned_alloc(size, align); + return (u8*)aligned_alloc(align, size); } static inline void heap_deallocate(u8* self, u8* ptr) { diff --git a/src/voidc.cc b/src/voidc.cc index 9e9c38f..2dd91f9 100644 --- a/src/voidc.cc +++ b/src/voidc.cc @@ -1,5 +1,6 @@ #include "memory.cc" #include "common.cc" +#include <cstring> static const char* SOURCE = R"( #include <stdlib.h> @@ -9,7 +10,7 @@ int main() { } )"; -static const String SOURCE_STRING = { (u8*)SOURCE, sizeof(SOURCE) - 1 }; +static const String SOURCE_STRING = { (u8*)SOURCE, strlen(SOURCE) }; int main() { String source; |
