os2: fix wiping results with temp allocator guard

This commit is contained in:
Laytan Laats
2024-08-14 01:44:37 +02:00
parent 7474db6a34
commit bd808f9ec6
15 changed files with 25 additions and 38 deletions
+3 -8
View File
@@ -45,8 +45,7 @@ full_path_from_name :: proc(name: string, allocator: runtime.Allocator) -> (path
name = "."
}
assert(!is_temp(allocator))
TEMP_ALLOCATOR_GUARD()
TEMP_ALLOCATOR_GUARD(ignore=is_temp(allocator))
p := win32_utf8_to_utf16(name, temp_allocator()) or_return
@@ -66,7 +65,7 @@ internal_stat :: proc(name: string, create_file_attributes: u32, allocator: runt
if len(name) == 0 {
return {}, .Not_Exist
}
TEMP_ALLOCATOR_GUARD()
TEMP_ALLOCATOR_GUARD(ignore=is_temp(allocator))
wname := _fix_long_path(name, temp_allocator()) or_return
fa: win32.WIN32_FILE_ATTRIBUTE_DATA
@@ -130,8 +129,7 @@ _cleanpath_from_handle :: proc(f: ^File, allocator: runtime.Allocator) -> (strin
return "", _get_platform_error()
}
assert(!is_temp(allocator))
TEMP_ALLOCATOR_GUARD()
TEMP_ALLOCATOR_GUARD(ignore=is_temp(allocator))
buf := make([]u16, max(n, 260)+1, temp_allocator())
n = win32.GetFinalPathNameByHandleW(h, raw_data(buf), u32(len(buf)), 0)
@@ -149,9 +147,6 @@ _cleanpath_from_handle_u16 :: proc(f: ^File) -> ([]u16, Error) {
return nil, _get_platform_error()
}
assert(!is_temp(allocator))
TEMP_ALLOCATOR_GUARD()
buf := make([]u16, max(n, 260)+1, temp_allocator())
n = win32.GetFinalPathNameByHandleW(h, raw_data(buf), u32(len(buf)), 0)
return _cleanpath_strip_prefix(buf[:n]), nil