_ prefixed top-level symbols now file-local
This commit is contained in:
+12
-12
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user