move hide behind @ and specify with :
This commit is contained in:
@@ -19,23 +19,23 @@ init func(allocator mem.Allocator) State {
|
||||
}
|
||||
}
|
||||
|
||||
hide fail_alloc func(_ ?@mut anyopaque, _ usize, _ usize) ?*mut u8 {
|
||||
@hide fail_alloc func(_ ?@mut anyopaque, _ usize, _ usize) ?*mut u8 {
|
||||
return null
|
||||
}
|
||||
|
||||
hide fail_realloc func(_ ?@mut anyopaque, _ ?*mut u8, _ usize, _ usize, _ usize) ?*mut u8 {
|
||||
@hide fail_realloc func(_ ?@mut anyopaque, _ ?*mut u8, _ usize, _ usize, _ usize) ?*mut u8 {
|
||||
return null
|
||||
}
|
||||
|
||||
hide fail_free func(_ ?@mut anyopaque, _ ?*mut u8, _ usize, _ usize) void {}
|
||||
@hide fail_free func(_ ?@mut anyopaque, _ ?*mut u8, _ usize, _ usize) void {}
|
||||
|
||||
hide fail_vtable mem.AllocatorVTable :: mem.AllocatorVTable {
|
||||
@hide fail_vtable mem.AllocatorVTable :: mem.AllocatorVTable {
|
||||
alloc = fail_alloc,
|
||||
realloc = fail_realloc,
|
||||
free = fail_free,
|
||||
}
|
||||
|
||||
hide fail_allocator mem.Allocator :: mem.Allocator {
|
||||
@hide fail_allocator mem.Allocator :: mem.Allocator {
|
||||
context = null,
|
||||
vtable = &fail_vtable,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
io :: import "@std/io"
|
||||
process :: import "@std/process"
|
||||
|
||||
hide read_ok func(_ ?@mut anyopaque, _ io.Handle, buffer []mut u8) usize ! io.ReadError {
|
||||
@hide read_ok func(_ ?@mut anyopaque, _ io.Handle, buffer []mut u8) usize ! io.ReadError {
|
||||
if buffer.len == 0 {
|
||||
return 0
|
||||
}
|
||||
@@ -13,26 +13,26 @@ hide read_ok func(_ ?@mut anyopaque, _ io.Handle, buffer []mut u8) usize ! io.Re
|
||||
return 2
|
||||
}
|
||||
|
||||
hide read_too_much func(_ ?@mut anyopaque, _ io.Handle, buffer []mut u8) usize ! io.ReadError {
|
||||
@hide read_too_much func(_ ?@mut anyopaque, _ io.Handle, buffer []mut u8) usize ! io.ReadError {
|
||||
return buffer.len + 1
|
||||
}
|
||||
|
||||
hide read_eof func(_ ?@mut anyopaque, _ io.Handle, _ []mut u8) usize ! io.ReadError {
|
||||
@hide read_eof func(_ ?@mut anyopaque, _ io.Handle, _ []mut u8) usize ! io.ReadError {
|
||||
return 0
|
||||
}
|
||||
|
||||
hide write_short func(_ ?@mut anyopaque, _ io.Handle, bytes []u8) usize ! io.WriteError {
|
||||
@hide write_short func(_ ?@mut anyopaque, _ io.Handle, bytes []u8) usize ! io.WriteError {
|
||||
if bytes.len > 2 {
|
||||
return 2
|
||||
}
|
||||
return bytes.len
|
||||
}
|
||||
|
||||
hide write_none func(_ ?@mut anyopaque, _ io.Handle, _ []u8) usize ! io.WriteError {
|
||||
@hide write_none func(_ ?@mut anyopaque, _ io.Handle, _ []u8) usize ! io.WriteError {
|
||||
return 0
|
||||
}
|
||||
|
||||
hide write_too_much func(_ ?@mut anyopaque, _ io.Handle, bytes []u8) usize ! io.WriteError {
|
||||
@hide write_too_much func(_ ?@mut anyopaque, _ io.Handle, bytes []u8) usize ! io.WriteError {
|
||||
return bytes.len + 1
|
||||
}
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
mem :: import "@std/mem"
|
||||
|
||||
hide probe_count func(context ?@mut anyopaque) void {
|
||||
@hide probe_count func(context ?@mut anyopaque) void {
|
||||
if context |raw| {
|
||||
count @mut usize :: ptrcast!(usize, raw)
|
||||
count^ += 1
|
||||
}
|
||||
}
|
||||
|
||||
hide probe_alloc func(context ?@mut anyopaque, _ usize, _ usize) ?*mut u8 {
|
||||
@hide probe_alloc func(context ?@mut anyopaque, _ usize, _ usize) ?*mut u8 {
|
||||
probe_count(context)
|
||||
return null
|
||||
}
|
||||
|
||||
hide probe_realloc func(context ?@mut anyopaque, _ ?*mut u8, _ usize, _ usize, _ usize) ?*mut u8 {
|
||||
@hide probe_realloc func(context ?@mut anyopaque, _ ?*mut u8, _ usize, _ usize, _ usize) ?*mut u8 {
|
||||
probe_count(context)
|
||||
return null
|
||||
}
|
||||
|
||||
hide probe_free func(context ?@mut anyopaque, _ ?*mut u8, _ usize, _ usize) void {
|
||||
@hide probe_free func(context ?@mut anyopaque, _ ?*mut u8, _ usize, _ usize) void {
|
||||
probe_count(context)
|
||||
}
|
||||
|
||||
hide probe_vtable mem.AllocatorVTable :: mem.AllocatorVTable {
|
||||
@hide probe_vtable mem.AllocatorVTable :: mem.AllocatorVTable {
|
||||
alloc = probe_alloc,
|
||||
realloc = probe_realloc,
|
||||
free = probe_free,
|
||||
|
||||
Reference in New Issue
Block a user