diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-08-21 21:02:01 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-08-21 21:02:01 -0400 |
| commit | 3d780cf2ef8391b6b48124f599858ee99ddc4cdc (patch) | |
| tree | 5e073a9784a6fa4699e0eca9a3eb0148756e6722 /std/debug | |
| parent | b2917e6be09138adcf7cfdab51a1909a30eec320 (diff) | |
| parent | 3dd1026c8bcb438228c336add7cc4014552aa05c (diff) | |
| download | zig-3d780cf2ef8391b6b48124f599858ee99ddc4cdc.tar.gz zig-3d780cf2ef8391b6b48124f599858ee99ddc4cdc.zip | |
Merge branch 'shawnl-path_max'
This does a proof of concept of changing most file system APIs to not
require an allocator and remove the possibility of failure via
OutOfMemory.
This also does most of the work of #534.
Diffstat (limited to 'std/debug')
| -rw-r--r-- | std/debug/index.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/std/debug/index.zig b/std/debug/index.zig index f06da85f54..4dbd8bf08d 100644 --- a/std/debug/index.zig +++ b/std/debug/index.zig @@ -255,7 +255,7 @@ pub fn printSourceAtAddress(debug_info: *ElfStackTrace, out_stream: var, address address, compile_unit_name, ); - if (printLineFromFile(debug_info.allocator(), out_stream, line_info)) { + if (printLineFromFile(out_stream, line_info)) { if (line_info.column == 0) { try out_stream.write("\n"); } else { @@ -340,8 +340,8 @@ pub fn openSelfDebugInfo(allocator: *mem.Allocator) !*ElfStackTrace { } } -fn printLineFromFile(allocator: *mem.Allocator, out_stream: var, line_info: *const LineInfo) !void { - var f = try os.File.openRead(allocator, line_info.file_name); +fn printLineFromFile(out_stream: var, line_info: *const LineInfo) !void { + var f = try os.File.openRead(line_info.file_name); defer f.close(); // TODO fstat and make sure that the file has the correct size |
