diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-26 13:49:27 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-26 13:49:27 -0800 |
commit | fe2a9b21e655041ef14e34c94509c6974f294866 (patch) | |
tree | 9228c5af516836f61c7f514a0a852df001723438 /starts/meaning-vm/level0.cpp | |
parent | 1c0b4c8ea8e32dddef0da99bbac546952bb20e44 (diff) | |
download | standingwithresilience-fe2a9b21e655041ef14e34c94509c6974f294866.tar.gz standingwithresilience-fe2a9b21e655041ef14e34c94509c6974f294866.zip |
level0 crucial memory defended
Diffstat (limited to 'starts/meaning-vm/level0.cpp')
-rw-r--r-- | starts/meaning-vm/level0.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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++); |