Add Allocator_Mode.Alloc_Non_Zerored
This commit is contained in:
1 parent
eb0d7465e2
commit
7f601c9535
21 files changed
+128
-65
No files matched your search
@@ -755,9 +755,15 @@ access :: proc(path: string, mask: int) -> (bool, Errno) {
|
||||
return true, ERROR_NONE
|
||||
}
|
||||
|
||||
heap_alloc :: proc(size: int) -> rawptr {
|
||||
assert(size >= 0)
|
||||
return _unix_calloc(1, c.size_t(size))
|
||||
heap_alloc :: proc(size: int, zero_memory := true) -> rawptr {
|
||||
if size <= 0 {
|
||||
return nil
|
||||
}
|
||||
if zero_memory {
|
||||
return _unix_calloc(1, c.size_t(size))
|
||||
} else {
|
||||
return _unix_malloc(c.size_t(size))
|
||||
}
|
||||
}
|
||||
|
||||
heap_resize :: proc(ptr: rawptr, new_size: int) -> rawptr {
|
||||
|
||||
Reference in new issue
Block a user