OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace commits / d6081d0

Set the copy-on-write flag for scratch spaces
d6081d075397da6c408e71ba8c3ddaba4475268d
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-21T22:00:33.000Z

Changed files (1) +10 -0

opencog/atoms/parallel/PureExecLink.cc +10 -0
……@@ -89,6 +89,7 @@ ValuePtr PureExecLink::execute(AtomSpace* as,
8989 if (nullptr == ctxt)
9090 {
9191 scratch = createAtomSpace(as);
92 scratch->set_copy_on_write();
9293 ctxt = scratch.get();
9394 }
9495
……@@ -110,6 +111,15 @@ ValuePtr PureExecLink::execute(AtomSpace* as,
110111 scratch->clear();
111112 }
112113
114 // The scratch space got placed into the parent. Remove it.
115 // Force a recursive remove, in case even more spaces got
116 // placed in there. (Does recursive remove for AtomSpaces work??)
117 if (scratch.get())
118 {
119 scratch->clear();
120 as->remove_atom(HandleCast(scratch), true);
121 }
122
113123 // Sop to the user. If only one item, return that one item.
114124 // This feels both hacky, and also reasonable. The hacky
115125 // feeling is that it behaves differently, based on size. Yuck.