dataRef to have the deallocation of the data managed by Nim GC. data for normal use through foo[10] (thanks to UncheckedArray). Yes data is public because in my use case this is only used internally, and getter/setter would just add boilerplate for no gain. Same thing for len.
Regarding copy, just think of it as an object with reference semantics, any ref object will have the same issue. My example was just to show that you can have the GC manage shared memory if you manually allocate it and use a finalizer for deallocation.
