diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2016-02-28 00:33:11 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2016-02-28 00:33:11 -0800 |
commit | e3970f9cbbd00289c551f947db0f4644654bd8d9 (patch) | |
tree | 6369fb3b8ab4b6f468b20c168030a76a4eba7db5 /src/parse_execution.cpp | |
parent | 077757a30b0ccd930b28cf3ed52d6c7a938156be (diff) |
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.
Diffstat (limited to 'src/parse_execution.cpp')
-rw-r--r-- | src/parse_execution.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<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) { } |