diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-05-02 23:11:33 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-05-02 23:11:33 -0700 |
commit | 3377364a849d938a9999357caf26853a844b238c (patch) | |
tree | d062357677f378df7104043d498d05bee53dbeca /010vm.cc | |
parent | 481fce0e5df70332ccb3a825efcf1e5db1f3e48b (diff) | |
download | mu-3377364a849d938a9999357caf26853a844b238c.tar.gz |
2891 - precompute container sizes and offsets
It's a bit of a trade-off because we need to store copies of container metadata in each reagent (to support shape-shifting containers), and metadata is not lightweight and will get heavier. But it'll become more unambiguously useful when we switch to a compiler.
Diffstat (limited to '010vm.cc')
-rw-r--r-- | 010vm.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/010vm.cc b/010vm.cc index eec9e2ff..d46719ad 100644 --- a/010vm.cc +++ b/010vm.cc @@ -56,6 +56,7 @@ struct reagent { vector<pair<string, string_tree*> > properties; // can't be a map because the string_tree sometimes needs to be NULL, which can be confusing double value; bool initialized; + // End reagent Fields reagent(string s); reagent() :type(NULL), value(0), initialized(false) {} ~reagent(); @@ -319,6 +320,7 @@ reagent::reagent(const reagent& old) { old.properties.at(i).second ? new string_tree(*old.properties.at(i).second) : NULL)); } type = old.type ? new type_tree(*old.type) : NULL; + // End reagent Copy Constructor } type_tree::type_tree(const type_tree& old) { @@ -346,6 +348,7 @@ reagent& reagent::operator=(const reagent& old) { initialized = old.initialized; if (type) delete type; type = old.type ? new type_tree(*old.type) : NULL; + // End reagent Copy Operator return *this; } |