os2: Resolve temp allocator collisions
This commit is contained in:
1 parent
4a709086a4
commit
b9db1dd3e0
34 files changed
+319
-314
No files matched your search
@@ -127,7 +127,7 @@ _process_info_by_pid :: proc(pid: int, selection: Process_Info_Fields, allocator
|
||||
break args
|
||||
}
|
||||
|
||||
buf := runtime.make_aligned([]byte, length, 4, temp_allocator())
|
||||
buf := runtime.make_aligned([]byte, length, 4, temp_allocator)
|
||||
if sysctl(raw_data(mib), 3, raw_data(buf), &length, nil, 0) != .OK {
|
||||
if err == nil {
|
||||
err = _get_platform_error()
|
||||
@@ -239,9 +239,9 @@ _process_list :: proc(allocator: runtime.Allocator) -> (list: []int, err: Error)
|
||||
return
|
||||
}
|
||||
|
||||
TEMP_ALLOCATOR_GUARD()
|
||||
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({ allocator }))
|
||||
|
||||
buffer := make([]i32, ret, temp_allocator())
|
||||
buffer := make([]i32, ret, temp_allocator)
|
||||
ret = darwin.proc_listallpids(raw_data(buffer), ret*size_of(i32))
|
||||
if ret < 0 {
|
||||
err = _get_platform_error()
|
||||
|
||||
Reference in new issue
Block a user