move hide behind @ and specify with :

This commit is contained in:
2026-08-10 22:45:41 +02:00
parent 5244bfbf1b
commit ba6052eef3
27 changed files with 162 additions and 149 deletions
+8 -8
View File
@@ -27,9 +27,9 @@ raw_free func(allocator Allocator, memory ?*mut u8, size usize, alignment usize)
allocator.vtable.free(allocator.context, memory, size, alignment)
}
hide empty_storage [1]mut u64 := [0]
@hide empty_storage [1]mut u64 := [0]
hide empty_slice func($T type, count usize) []mut T {
@hide empty_slice func($T type, count usize) []mut T {
pointer *mut T :: ptrcast!(T, (&empty_storage).ptr)
return pointer[..count]
}
@@ -61,9 +61,9 @@ free func($T type, allocator Allocator, memory []mut T) void {
}
}
hide malloc_alignment usize :: 16 # ponytail: aarch64-macos libc malloc alignment assumption.
@hide malloc_alignment usize :: 16 # ponytail: aarch64-macos libc malloc alignment assumption.
hide power_of_two func(value usize) bool {
@hide power_of_two func(value usize) bool {
if value == 0 {
return false
}
@@ -80,7 +80,7 @@ hide power_of_two func(value usize) bool {
return true
}
hide c_alloc func(_ ?@mut anyopaque, size usize, alignment usize) ?*mut u8 {
@hide c_alloc func(_ ?@mut anyopaque, size usize, alignment usize) ?*mut u8 {
if power_of_two(alignment) == false {
return null
}
@@ -98,7 +98,7 @@ hide c_alloc func(_ ?@mut anyopaque, size usize, alignment usize) ?*mut u8 {
return ptrcast!(u8, memory[0])
}
hide c_realloc func(_ ?@mut anyopaque, memory ?*mut u8, old_size usize, new_size usize, alignment usize) ?*mut u8 {
@hide c_realloc func(_ ?@mut anyopaque, memory ?*mut u8, old_size usize, new_size usize, alignment usize) ?*mut u8 {
if power_of_two(alignment) == false {
return null
}
@@ -131,11 +131,11 @@ hide c_realloc func(_ ?@mut anyopaque, memory ?*mut u8, old_size usize, new_size
return c_alloc(null, new_size, alignment)
}
hide c_free func(_ ?*mut anyopaque, memory ?*mut u8, _ usize, _ usize) void {
@hide c_free func(_ ?@mut anyopaque, memory ?*mut u8, _ usize, _ usize) void {
c.free(memory)
}
hide c_vtable AllocatorVTable :: AllocatorVTable {
@hide c_vtable AllocatorVTable :: AllocatorVTable {
alloc = c_alloc,
realloc = c_realloc,
free = c_free,