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/errmsg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/errmsg.cpp') diff --git a/src/errmsg.cpp b/src/errmsg.cpp index 9425b110c3..7bf096547f 100644 --- a/src/errmsg.cpp +++ b/src/errmsg.cpp @@ -99,7 +99,7 @@ void err_msg_add_note(ErrorMsg *parent, ErrorMsg *note) { ErrorMsg *err_msg_create_with_offset(Buf *path, size_t line, size_t column, size_t offset, const char *source, Buf *msg) { - ErrorMsg *err_msg = allocate(1); + ErrorMsg *err_msg = heap::c_allocator.create(); err_msg->path = path; err_msg->line_start = line; err_msg->column_start = column; @@ -138,7 +138,7 @@ ErrorMsg *err_msg_create_with_offset(Buf *path, size_t line, size_t column, size ErrorMsg *err_msg_create_with_line(Buf *path, size_t line, size_t column, Buf *source, ZigList *line_offsets, Buf *msg) { - ErrorMsg *err_msg = allocate(1); + ErrorMsg *err_msg = heap::c_allocator.create(); err_msg->path = path; err_msg->line_start = line; err_msg->column_start = column; -- cgit v1.2.3