bug fixes

This commit is contained in:
2026-07-12 10:13:19 +02:00
parent cff9e9500f
commit b0c716537e
14 changed files with 847 additions and 106 deletions
+6 -6
View File
@@ -1,9 +1,7 @@
c :: import "@ffi/c"
AllocatorVTable :: struct {
alloc @func(context ?*mut anyopaque, size usize, alignment usize) ?*mut u8
realloc @func(context ?*mut anyopaque, memory ?*mut u8, old_size usize, new_size usize, alignment usize) ?*mut u8
free @func(context ?*mut anyopaque, memory ?*mut u8, size usize, alignment usize) void
AllocError :: enum {
out_of_memory
}
Allocator :: struct {
@@ -11,8 +9,10 @@ Allocator :: struct {
vtable @AllocatorVTable
}
AllocError :: enum {
out_of_memory
AllocatorVTable :: struct {
alloc @func(context ?*mut anyopaque, size usize, alignment usize) ?*mut u8
realloc @func(context ?*mut anyopaque, memory ?*mut u8, old_size usize, new_size usize, alignment usize) ?*mut u8
free @func(context ?*mut anyopaque, memory ?*mut u8, size usize, alignment usize) void
}
raw_alloc func(allocator Allocator, size usize, alignment usize) ?*mut u8 {