Add runtime.DEFAULT_TEMP_ALLOCATOR_TEMP_GUARD where appropriate

This commit is contained in:
gingerBill
2023-02-10 16:23:33 +00:00
parent b427a4c8c9
commit 986cba584e
31 changed files with 201 additions and 60 deletions
+2
View File
@@ -2,6 +2,7 @@ package os
import "core:strings"
import "core:mem"
import "core:runtime"
read_dir :: proc(fd: Handle, n: int, allocator := context.allocator) -> (fi: []File_Info, err: Errno) {
dirp: Dir
@@ -51,6 +52,7 @@ read_dir :: proc(fd: Handle, n: int, allocator := context.allocator) -> (fi: []F
continue
}
runtime.DEFAULT_TEMP_ALLOCATOR_TEMP_GUARD(ignore = context.temp_allocator == allocator)
fullpath := strings.join( []string{ dirpath, filename }, "/", context.temp_allocator)
defer delete(fullpath, context.temp_allocator)