From edb210905dcbe666fa5222bceacd2e5bdb16bb89 Mon Sep 17 00:00:00 2001 From: Michael Dusan Date: Mon, 10 Feb 2020 21:08:08 -0500 Subject: stage1: memory/report overhaul - split util_base.hpp from util.hpp - new namespaces: `mem` and `heap` - new `mem::Allocator` interface - new `heap::CAllocator` impl with global `heap::c_allocator` - new `heap::ArenaAllocator` impl - new `mem::TypeInfo` extracts names without RTTI - name extraction is enabled w/ ZIG_ENABLE_MEM_PROFILE=1 - new `mem::List` takes explicit `Allocator&` parameter - new `mem::HashMap` takes explicit `Allocator&` parameter - add Codegen.pass1_arena and use for all `ZigValue` allocs - deinit Codegen.pass1_arena early in `zig_llvm_emit_output()` --- src/tokenizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tokenizer.cpp') diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 2aae048cdf..d3390aef3c 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -397,10 +397,10 @@ static void invalid_char_error(Tokenize *t, uint8_t c) { void tokenize(Buf *buf, Tokenization *out) { Tokenize t = {0}; t.out = out; - t.tokens = out->tokens = allocate>(1); + t.tokens = out->tokens = heap::c_allocator.create>(); t.buf = buf; - out->line_offsets = allocate>(1); + out->line_offsets = heap::c_allocator.create>(); out->line_offsets->append(0); // Skip the UTF-8 BOM if present -- cgit v1.2.3