mem: typed allocation helpers + drop bare malloc/free (Phase 2.2); resolve 0119 as |>-contract clarification
This commit is contained in:
@@ -15,7 +15,7 @@ Tracer :: struct {
|
||||
count: s64;
|
||||
|
||||
init :: () -> *Tracer {
|
||||
t : *Tracer = xx malloc(size_of(Tracer));
|
||||
t : *Tracer = xx libc_malloc(size_of(Tracer));
|
||||
t.count = 0;
|
||||
t
|
||||
}
|
||||
@@ -24,10 +24,10 @@ Tracer :: struct {
|
||||
impl Allocator for Tracer {
|
||||
alloc_bytes :: (self: *Tracer, size: s64) -> *void {
|
||||
self.count += 1;
|
||||
return malloc(size);
|
||||
return libc_malloc(size);
|
||||
}
|
||||
dealloc_bytes :: (self: *Tracer, ptr: *void) {
|
||||
free(ptr);
|
||||
libc_free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user