bug fixes
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import "@ffi/c"
|
||||
import "@std/mem"
|
||||
|
||||
main func() void {
|
||||
allocator :: mem.c_allocator
|
||||
|
||||
data :: mem.alloc(u8, allocator, 24) catch |_| {
|
||||
_ = c.printf("Failed to allocate memory\n")
|
||||
return _
|
||||
}
|
||||
defer mem.free(u8, allocator, data)
|
||||
|
||||
data[0] = 'H'
|
||||
_ = c.printf("data[0] = %s\n", data[0])
|
||||
}
|
||||
Reference in New Issue
Block a user