Remove TEMP_ALLOCATOR_GUARD wrapper

This commit is contained in:
Lucas Perlind
2025-05-08 17:41:03 +10:00
parent 5292a7f4f3
commit 9f2d008a8a
33 changed files with 113 additions and 116 deletions
+2 -2
View File
@@ -119,7 +119,7 @@ clean_path :: proc(path: string, allocator: runtime.Allocator) -> (cleaned: stri
return strings.clone(".", allocator)
}
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({ allocator }))
temp_allocator := TEMP_ALLOCATOR_GUARD({ allocator })
// The extra byte is to simplify appending path elements by letting the
// loop to end each with a separator. We'll trim the last one when we're done.
@@ -326,7 +326,7 @@ For example, `join_path({"/home", "foo", "bar.txt"})` will result in `"/home/foo
join_path :: proc(elems: []string, allocator: runtime.Allocator) -> (joined: string, err: Error) {
for e, i in elems {
if e != "" {
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({ allocator }))
temp_allocator := TEMP_ALLOCATOR_GUARD({ allocator })
p := strings.join(elems[i:], Path_Separator_String, temp_allocator) or_return
return clean_path(p, allocator)
}