From e3970f9cbbd00289c551f947db0f4644654bd8d9 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 28 Feb 2016 00:33:11 -0800 Subject: Allow parse_execution_context to take ownership of a parse tree Introduces a new template moved_ref which is like an rvalue reference. This allows passing around objects while being explicit that the receiver may acquire ownership. This will help reduce some allocations. --- src/parse_execution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parse_execution.cpp') diff --git a/src/parse_execution.cpp b/src/parse_execution.cpp index c0c10a75..60885760 100644 --- a/src/parse_execution.cpp +++ b/src/parse_execution.cpp @@ -66,7 +66,7 @@ static wcstring profiling_cmd_name_for_redirectable_block(const parse_node_t &no return result; } -parse_execution_context_t::parse_execution_context_t(const parse_node_tree_t &t, const wcstring &s, parser_t *p, int initial_eval_level) : tree(t), src(s), parser(p), eval_level(initial_eval_level), executing_node_idx(NODE_OFFSET_INVALID), cached_lineno_offset(0), cached_lineno_count(0) +parse_execution_context_t::parse_execution_context_t(moved_ref t, const wcstring &s, parser_t *p, int initial_eval_level) : tree(t), src(s), parser(p), eval_level(initial_eval_level), executing_node_idx(NODE_OFFSET_INVALID), cached_lineno_offset(0), cached_lineno_count(0) { } -- cgit v1.2.3