@@ -107,17 +107,17 @@ read_entire_file :: proc{
107107}
108108
109109@(require_results)
110- read_entire_file_from_path :: proc (name: string , allocator: runtime.Allocator) -> (data: []byte , err: Error) {
110+ read_entire_file_from_path :: proc (name: string , allocator: runtime.Allocator, loc := #caller_location ) -> (data: []byte , err: Error) {
111111 f, ferr := open (name)
112112 if ferr != nil {
113113 return nil , ferr
114114 }
115115 defer close (f)
116- return read_entire_file_from_file (f, allocator)
116+ return read_entire_file_from_file (f=f , allocator=allocator, loc=loc )
117117}
118118
119119@(require_results)
120- read_entire_file_from_file :: proc (f: ^File, allocator: runtime.Allocator) -> (data: []byte , err: Error) {
120+ read_entire_file_from_file :: proc (f: ^File, allocator: runtime.Allocator, loc := #caller_location ) -> (data: []byte , err: Error) {
121121 size: int
122122 has_size := false
123123 if size64, serr := file_size (f); serr == nil {
@@ -129,7 +129,7 @@ read_entire_file_from_file :: proc(f: ^File, allocator: runtime.Allocator) -> (d
129129
130130 if has_size && size > 0 {
131131 total: int
132- data = make ([]byte , size, allocator) or_return
132+ data = make ([]byte , size, allocator, loc ) or_return
133133 for total < len (data) {
134134 n: int
135135 n, err = read (f, data[total:])
@@ -145,7 +145,7 @@ read_entire_file_from_file :: proc(f: ^File, allocator: runtime.Allocator) -> (d
145145 return
146146 } else {
147147 buffer: [1024 ]u8
148- out_buffer := make ([dynamic ]u8 , 0 , 0 , allocator)
148+ out_buffer := make ([dynamic ]u8 , 0 , 0 , allocator, loc )
149149 total := 0
150150 for {
151151 n: int
0 commit comments