From fe2a9b21e655041ef14e34c94509c6974f294866 Mon Sep 17 00:00:00 2001 From: olpc user Date: Thu, 26 Dec 2019 13:49:27 -0800 Subject: level0 crucial memory defended --- starts/meaning-vm/level0.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'starts/meaning-vm') diff --git a/starts/meaning-vm/level0.cpp b/starts/meaning-vm/level0.cpp index 6beb789..f15b90d 100644 --- a/starts/meaning-vm/level0.cpp +++ b/starts/meaning-vm/level0.cpp @@ -46,19 +46,21 @@ int main() try { dealloc(a.get(codelink), a); throw "deallocd crucial concept"; - } catch (crucial_concept e) { + } catch (crucial_concept & e) { realloc(a.get(codelink), concepts::level0allocations()); } a.setcrucial(codelink, a.get(codelink)); + a.setcrucial(numlink, a.get(numlink)); try { a.unlink(codelink); throw "unlinkd crucial link"; - } catch (crucial_link_type_target e) { + } catch (crucial_link_type_target & e) { realloc(a, concepts::level0allocations()); realloc(codelink, concepts::level0allocations()); + realloc(numlink, concepts::level0allocations()); } - for (auto c : { a, a.get(codelink) } ) + for (auto c : { a, a.get(codelink), a.get(numlink) } ) for (auto it = c.links().begin(); it != c.links().end();) { if (!c.crucial(it) && !it->first.linked(concepts::allocator(), concepts::level0allocations())) { c.unlink(it++); -- cgit v1.2.3