chromatic (via RT) wrote:

Hi there,

This test case and patch demonstrates and fixes a problem where *Structs
sharing initializers that contain structs end up sharing a single nested
*Struct.

I'm not convinced the behavior is completely correct. It breaks one
other test

I'd rather not have the cloning in the C code. If you don't reuse the nested structure descriptor, it's wasting resources.


I think implementing the C< clone > vtable in unmanaged struct would be much cleaner. If you want to reuse a structure then clone it in the code.

The question with C< clone > just is: how deep should it copy. This holds as well for arrays and hashes.

Anyway, if it's a deep copy, then we probably would need freeze/thaw in the UnManagedStruct PMC.

leo



Reply via email to