about summary refs log tree commit diff stats
path: root/030container.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-05-17 12:35:06 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-05-17 12:50:43 -0700
commit51b53b13f9d88b42ca81510b41a91340bab72ccc (patch)
tree31083eaa868d2ee8b409fff9b11055e87d44d7cf /030container.cc
parentcaa4275c9a56f4e64ea3bcaf572f76445d305d93 (diff)
downloadmu-51b53b13f9d88b42ca81510b41a91340bab72ccc.tar.gz
2968
More reorganization in preparation for implementing recursive abandon().

Refcounts are getting incredibly hairy. I need to juggle containers
containing other containers, and containers *pointing* to other
containers. For a while I considered getting rid of address_element_info
entirely and just going by types for every single
update_refcount. But that's definitely more work, and it's unclear that
things will be cleaner/shorter/simpler. I haven't measured the speedup,
but it seems worth optimizing every pointer copy to make sure we aren't
manipulating types at runtime.

The key insight now is a) to continue to compute information about
nested containers at load time, because that's the common case when
updating refcounts, but b) to compute information about *pointed* values
at run-time, because that's the uncommon case.

As a result, we're going to cheat in the interpreter and use type
information at runtime just for abandon(), just because the
corresponding task when we get to a compiler will be radically
different. It will still be tractable, though.
Diffstat (limited to '030container.cc')
-rw-r--r--030container.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/030container.cc b/030container.cc
index 902afb21..387693ef 100644
--- a/030container.cc
+++ b/030container.cc
@@ -96,7 +96,7 @@ def main [
 //: Can't put this in type_info because later layers will add support for more
 //: complex type trees where metadata depends on *combinations* of types.
 
-:(after "Types")
+:(before "struct reagent")
 struct container_metadata {
   int size;
   vector<int> offset;