zigself icon indicating copy to clipboard operation
zigself copied to clipboard

Byte arrays don't copy their values when cloned

Open sin-ack opened this issue 4 years ago • 0 comments

I had hit a similar issue with array objects, which I solved by moving the array values inline with the array object instead of storing them on the map. However, since byte arrays are in a separate segment of the heap space, this is even simpler; it boils down to adding a clone() method on the ByteArray struct and using that new byte array while creating the clone. Tangentially related to #3, as fixing that requires moving the byte array pointer to individual byte array objects.

sin-ack avatar Feb 28 '22 17:02 sin-ack