about summary refs log tree commit diff stats
path: root/010vm.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-04-28 17:23:50 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-04-28 17:36:30 -0700
commit7858a06a5444328594bac9a9213bcbdda20580d6 (patch)
tree7a3612d8d2388a966dc1e5162404922a227a8451 /010vm.cc
parent4f5bb5b6b199b9ccf1bf12082436d9f841559b2c (diff)
downloadmu-7858a06a5444328594bac9a9213bcbdda20580d6.tar.gz
2882 - warn if programmer overuses transform_all()
This continues a line of thought sparked in commit 2831. I spent a while
trying to avoid calling size_of() at transform-time, but there's no
getting around the fact that translating names to addresses requires
knowing how much space they need.

This raised the question of what happens if the size of a container
changes after a recipe using it is already transformed. I could go down
the road of trying to detect such situations and redoing work, but that
massively goes against the grain of my original design, which assumed
that recipes don't get repeatedly transformed. Even though we call
transform_all() in every test, in a non-testing run we should be loading
all code and calling transform_all() just once to 'freeze-dry'
everything.

But even if we don't want to support multiple transforms it's worth
checking that they don't occur. This commit does so in just one
situation. There are likely others.
Diffstat (limited to '010vm.cc')
-rw-r--r--010vm.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/010vm.cc b/010vm.cc
index 1f33c9cf..eec9e2ff 100644
--- a/010vm.cc
+++ b/010vm.cc
@@ -171,7 +171,9 @@ struct type_info {
   kind_of_type kind;
   vector<reagent> elements;
   // End type_info Fields
-  type_info() :kind(PRIMITIVE) {}
+  type_info() :kind(PRIMITIVE) {
+    // End type_info Constructor
+  }
 };
 
 enum primitive_recipes {