_ prefixed top-level symbols now file-local

This commit is contained in:
2026-07-11 23:37:30 +02:00
parent 6dd6b7ff54
commit 220b1c6e82
15 changed files with 282 additions and 90 deletions
+12 -12
View File
@@ -7,6 +7,18 @@ Allocator :: struct {
free @func(context ?*mut anyopaque, memory ?*mut u8, size usize, alignment usize) void
}
alloc func(allocator Allocator, size usize, alignment usize) ?*mut u8 {
return allocator.alloc(allocator.context, size, alignment)
}
realloc func(allocator Allocator, memory ?*mut u8, old_size usize, new_size usize, alignment usize) ?*mut u8 {
return allocator.realloc(allocator.context, memory, old_size, new_size, alignment)
}
free func(allocator Allocator, memory ?*mut u8, size usize, alignment usize) void {
allocator.free(allocator.context, memory, size, alignment)
}
_malloc_alignment usize :: 16 # ponytail: aarch64-macos libc malloc alignment assumption.
_power_of_two func(value usize) bool {
@@ -87,15 +99,3 @@ c_allocator Allocator :: Allocator {
realloc = _c_realloc,
free = _c_free,
}
alloc func(allocator Allocator, size usize, alignment usize) ?*mut u8 {
return allocator.alloc(allocator.context, size, alignment)
}
realloc func(allocator Allocator, memory ?*mut u8, old_size usize, new_size usize, alignment usize) ?*mut u8 {
return allocator.realloc(allocator.context, memory, old_size, new_size, alignment)
}
free func(allocator Allocator, memory ?*mut u8, size usize, alignment usize) void {
allocator.free(allocator.context, memory, size, alignment)
}