Leopold Toetsch wrote:

Steve Fink wrote:

  (3) propose something else that solves the whole problem neatly.
i.e. reorder code where possible, and anchor early,
RFC: changing the clone op functionality slightly:

Clone does in the first step pmc_new{,noinit} a PMC of the desired type. This is common to all classes. Then class specific deep copying jumps in.
I would like to change the clone functionality slightly to be:

inline op clone(out PMC, in PMC) {
$1 = pmc_new_noinit(interpreter, $2->vtable->type());
$2->vtable->clone(interpreter, $2, $1);
goto NEXT();
}

So, the newly created PMC would be anchored to the root set immediately. Cloning e.g a KEY, which currently would be b0rken, could then be done w/o disabling DOD.

leo

Reply via email to