diff options
| -rw-r--r-- | core/mem/allocators.odin | 4 | ||||
| -rw-r--r-- | core/os/os2/file_util.odin | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/core/mem/allocators.odin b/core/mem/allocators.odin index 5b0b178f8..eea7a5b4f 100644 --- a/core/mem/allocators.odin +++ b/core/mem/allocators.odin @@ -99,8 +99,8 @@ panic_allocator :: proc() -> Allocator { panic_allocator_proc :: proc( allocator_data: rawptr, mode: Allocator_Mode, - size, alignment: int, - old_memory: rawptr, + size, alignment: int, + old_memory: rawptr, old_size: int, loc := #caller_location, ) -> ([]byte, Allocator_Error) { diff --git a/core/os/os2/file_util.odin b/core/os/os2/file_util.odin index 579acd2da..5934f02f5 100644 --- a/core/os/os2/file_util.odin +++ b/core/os/os2/file_util.odin @@ -108,12 +108,9 @@ read_entire_file :: proc{ @(require_results) read_entire_file_from_path :: proc(name: string, allocator: runtime.Allocator, loc := #caller_location) -> (data: []byte, err: Error) { - f, ferr := open(name) - if ferr != nil { - return nil, ferr - } + f := open(name) or_return defer close(f) - return read_entire_file_from_file(f=f, allocator=allocator, loc=loc) + return read_entire_file_from_file(f, allocator, loc) } @(require_results) @@ -151,7 +148,7 @@ read_entire_file_from_file :: proc(f: ^File, allocator: runtime.Allocator, loc : n: int n, err = read(f, buffer[:]) total += n - append_elems(&out_buffer, ..buffer[:n]) or_return + append_elems(&out_buffer, ..buffer[:n], loc=loc) or_return if err != nil { if err == .EOF || err == .Broken_Pipe { err = nil |