mem: typed allocation helpers + drop bare malloc/free (Phase 2.2); resolve 0119 as |>-contract clarification
This commit is contained in:
@@ -16,7 +16,7 @@ Box :: struct {
|
||||
first_ptr: *void;
|
||||
|
||||
init :: (parent_alloc: Allocator, size: s64) -> *Box {
|
||||
self : *Box = xx malloc(size_of(Box));
|
||||
self : *Box = xx libc_malloc(size_of(Box));
|
||||
self.parent = parent_alloc;
|
||||
self.first_ptr = self.parent.alloc_bytes(size);
|
||||
self
|
||||
@@ -24,7 +24,7 @@ Box :: struct {
|
||||
}
|
||||
|
||||
make_box :: (parent_alloc: Allocator, size: s64) -> *Box {
|
||||
self : *Box = xx malloc(size_of(Box));
|
||||
self : *Box = xx libc_malloc(size_of(Box));
|
||||
self.parent = parent_alloc;
|
||||
self.first_ptr = self.parent.alloc_bytes(size);
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user