Files
2024-04-13 15:29:53 +02:00

16 lines
329 B
Plaintext

import "libc";
SourceLoc :: struct {
file: String;
line: int;
}
Allocate :: proc(size: int, source_loc: SourceLoc = {}): *void {
printf("%.*s:%d\n", source_loc.file.len, source_loc.file.str, source_loc.line);
return malloc(:size_t(size));
}
main :: proc(): int {
value: *int = Allocate(32);
return 0;
}