From 51b53b13f9d88b42ca81510b41a91340bab72ccc Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 17 May 2016 12:35:06 -0700 Subject: 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. --- 010vm.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to '010vm.cc') diff --git a/010vm.cc b/010vm.cc index 7c2ccba1..ee18a171 100644 --- a/010vm.cc +++ b/010vm.cc @@ -98,6 +98,8 @@ struct string_tree { string_tree(string_tree* l, string_tree* r) :left(l), right(r) {} }; +// End type_tree Definition + :(before "End Globals") // Locations refer to a common 'memory'. Each location can store a number. map Memory; -- cgit 1.4.1-2-gfad0