zigself
zigself copied to clipboard
Byte arrays don't copy their values when cloned
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.