21 lines
285 B
Plaintext
21 lines
285 B
Plaintext
mem :: import "@std/mem"
|
|
|
|
main func() i32 {
|
|
memory ?*mut u8 = mem.alloc(mem.heap, 4, 1)
|
|
defer mem.free(mem.heap, memory, 4, 1)
|
|
|
|
if memory |bytes| {
|
|
bytes[0] = 10
|
|
bytes[1] = 20
|
|
bytes[2] = bytes[0] + bytes[1]
|
|
|
|
if (bytes[2] != 30) {
|
|
return 2
|
|
}
|
|
|
|
return 0
|
|
}
|
|
|
|
return 1
|
|
}
|