aboutsummaryrefslogtreecommitdiff
path: root/std/debug/index.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-02-09 18:27:50 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-02-09 18:27:50 -0500
commita2bd9f8912ade5149855dc6e2371aaae49093660 (patch)
tree04dab23f1d6d730b5266506422daf820124fa139 /std/debug/index.zig
parente7bf8f3f04efc280a76a3a38b4e6d470d279e41a (diff)
downloadzig-a2bd9f8912ade5149855dc6e2371aaae49093660.tar.gz
zig-a2bd9f8912ade5149855dc6e2371aaae49093660.zip
std lib: modify allocator idiom
Before we accepted a nullable allocator for some stuff like opening files. Now we require an allocator. Use the mem.FixedBufferAllocator pattern if a bound on the amount to allocate is known. This also establishes the pattern that usually an allocator is the first argument to a function (possibly after "self"). fix docs for std.cstr.addNullByte self hosted compiler: * only build docs when explicitly asked to * clean up main * stub out zig fmt
Diffstat (limited to 'std/debug/index.zig')
-rw-r--r--std/debug/index.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/std/debug/index.zig b/std/debug/index.zig
index 2bb03a6706..9c27d84375 100644
--- a/std/debug/index.zig
+++ b/std/debug/index.zig
@@ -265,7 +265,7 @@ pub fn openSelfDebugInfo(allocator: &mem.Allocator) !&ElfStackTrace {
}
fn printLineFromFile(allocator: &mem.Allocator, out_stream: var, line_info: &const LineInfo) !void {
- var f = try io.File.openRead(line_info.file_name, allocator);
+ var f = try io.File.openRead(allocator, line_info.file_name);
defer f.close();
// TODO fstat and make sure that the file has the correct size