Alias heap calls from base:runtime is core:os

This commit is contained in:
gingerBill
2024-01-28 22:47:55 +00:00
parent 9a16bc5fc5
commit 038086d1d9
13 changed files with 50 additions and 316 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ foreign libc {
@(link_name="realloc") _unix_realloc :: proc(ptr: rawptr, size: int) -> rawptr ---
}
heap_alloc :: proc(size: int, zero_memory := true) -> rawptr {
_heap_alloc :: proc(size: int, zero_memory := true) -> rawptr {
if size <= 0 {
return nil
}
@@ -27,12 +27,12 @@ heap_alloc :: proc(size: int, zero_memory := true) -> rawptr {
}
}
heap_resize :: proc(ptr: rawptr, new_size: int) -> rawptr {
_heap_resize :: proc(ptr: rawptr, new_size: int) -> rawptr {
// NOTE: _unix_realloc doesn't guarantee new memory will be zeroed on
// POSIX platforms. Ensure your caller takes this into account.
return _unix_realloc(ptr, new_size)
}
heap_free :: proc(ptr: rawptr) {
_heap_free :: proc(ptr: rawptr) {
_unix_free(ptr)
}