Problems with Dynamic Objects extension

I’ve been trying to use the Dynamic Objects extension by Jesse McGrew, but whenever I clone an object, all of their properties are linked to the properties of the original (and any additional clones), such that changing the properties of one changes the properties of all of them. I assume this is what “fixing” properties is for (“Section: Handling block value properties” in the documentation), but attempting to use it (including using the example from the documentation) causes a run-time error:

*** Value handling failed: impossible allocation ***

*** Run-time problem P49: Memory allocation proved impossible.

Since I was unable to find any information about that specific error, I talked to Jesse, who said that there may have been changes to I7 that caused it to no longer work, and suggested that I ask here so that someone who is more aware of anything that may have changed in Inform might be able to help.

Here’s a patched Dynamic Objects in my fork of the Friends repo. It changes:

Include (-
[ DO_UnlinkProp prop obj  v;
	v = obj.prop;
	obj.prop = BlkValueCreate(v-->BLK_HEADER_KOV);
	BlkValueCopy(obj.prop, v);
];
-).

To fix the/-- cloned (P - pointer value valued property) property/--: (- DO_UnlinkProp({P}, (+ new object +)); -).

to

Include (-
[ DO_UnlinkProp prop obj v;
v = obj.prop;
obj.prop = BlkValueCreate(BlkValueWeakKind(v));
BlkValueCopy(obj.prop, v);
];
-).

and of things I’ve tried, it appears to work for texts, but not lists.

1 Like