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
+4 -4
View File
@@ -74,7 +74,7 @@ write_all func(writer Writer, bytes []u8) void ! WriteError {
return
}
hide system_read func(_ ?*mut anyopaque, stream ReadStream, buffer []mut u8) usize ! ReadError {
@hide system_read func(_ ?*mut anyopaque, stream ReadStream, buffer []mut u8) usize ! ReadError {
request usize := buffer.len
maximum usize :: usize(maxval!(c_long))
if request > maximum {
@@ -91,7 +91,7 @@ hide system_read func(_ ?*mut anyopaque, stream ReadStream, buffer []mut u8) usi
}
}
hide system_write func(_ ?*mut anyopaque, stream WriteStream, bytes []mut u8) usize ! WriteError {
@hide system_write func(_ ?*mut anyopaque, stream WriteStream, bytes []u8) usize ! WriteError {
fd c_int :: c_int(stream)
request usize := bytes.len
maximum usize :: usize(maxval!(c_long))
@@ -109,12 +109,12 @@ hide system_write func(_ ?*mut anyopaque, stream WriteStream, bytes []mut u8) us
}
}
hide system_vtable IoVTable :: IoVTable {
@hide system_vtable IoVTable :: IoVTable {
read = system_read,
write = system_write,
}
hide system func() Io {
@hide system func() Io {
return Io {
context = null,
vtable = &system_vtable,
+8 -8
View File
@@ -41,9 +41,9 @@ eql func($T type, left, right []T) bool {
return true
}
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]
}
@@ -116,9 +116,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
}
@@ -135,7 +135,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
}
@@ -153,7 +153,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
}
@@ -186,11 +186,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,