sin-ack / zigself

An implementation of the Self programming language in Zig
GNU General Public License v3.0
161 stars 5 forks source link

Fix `HandleArea` after latest Zig compiler changes #19

Closed sin-ack closed 1 year ago

sin-ack commented 1 year ago

The following change creates a compiler error: https://github.com/ziglang/zig/commit/ceb0a632cfd6a4eada6bd27bf6a3754e95dcac86

The Allocator API no longer handles allocations with alignment > page size. For this, we're going to have to use platform-specific functions until a std API for this emerges.

POSIX: posix_memalign https://linux.die.net/man/3/posix_memalign Windows: VirtualAlloc2 https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc2 WASM: ??? I wasn't able to find any information on aligned allocations.

sin-ack commented 1 year ago

Fixed with befc715ca9f558c6ca87a9d65d0ba71995b291a7.