os2: Resolve temp allocator collisions

This commit is contained in:
Lucas Perlind
2025-05-08 17:41:01 +10:00
parent 4a709086a4
commit b9db1dd3e0
34 changed files with 319 additions and 314 deletions
+3 -3
View File
@@ -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()