This commit is contained in:
Lucas Perlind
2025-04-30 19:56:52 +10:00
parent b9db1dd3e0
commit 190960e103
3 changed files with 2 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ TEMP_ALLOCATOR_GUARD :: #force_inline proc(collisions: []runtime.Allocator, loc
Temp_Allocator :: struct {
using arena: ^runtime.Arena,
using allocator: runtime.Allocator
using allocator: runtime.Allocator,
}
get_temp_allocator :: proc(tmp: runtime.Arena_Temp, _: runtime.Source_Code_Location) -> Temp_Allocator {

View File

@@ -206,7 +206,7 @@ copy_directory :: proc(dst, src: string, dst_perm := 0o755) -> Error {
file_infos := read_all_directory_by_path(src, temp_allocator) or_return
for fi in file_infos {
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({}))
temp_allocator_scope(temp_allocator)
dst_path := join_path({dst, fi.name}, temp_allocator) or_return
src_path := fi.fullpath

View File

@@ -51,8 +51,6 @@ Read_Directory_Iterator_Impl :: struct {
@(require_results)
_read_directory_iterator :: proc(it: ^Read_Directory_Iterator) -> (fi: File_Info, index: int, ok: bool) {
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({}))
for !it.impl.no_more_files {
err: Error
file_info_delete(it.impl.prev_fi, file_allocator())