aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2025-10-28 12:29:23 +0100
committerGitHub <noreply@github.com>2025-10-28 12:29:23 +0100
commit8795c13d00747f5b29b2347ca96b4add36acabed (patch)
treed11f35e17d9344c865c60525f98ef268dba103e0
parent1333170dd6f1c17a24240635209c0742233d6bd6 (diff)
parent4c8f99cd36ec05dca1b03a5935b92685549b5717 (diff)
Merge branch 'master' into core_os2_revamp
-rw-r--r--core/mem/allocators.odin4
-rw-r--r--core/os/os2/file_util.odin9
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