First we no longer set a mark function for msgpack:buffer_view objects, instead we mark the msgpack_buffer_t struct from the owner (packer or unpacker) mark function. This IMO is much cleaner, and allow us to no longer create the Buffer instance eagerly for GC purposes. Given that accessing the buffer is a very rare use case, it is a bit wasteful.
The second change is simply to remove #dup and #clone on all the classes that never intended to have them defined. Closing buffer, packer or unpacker would copy the content of the struct, but that's a shallow copy so it might lead to leaks or use after frees etc.
Two commits for two changes here.
First we no longer set a mark function for
msgpack:buffer_view
objects, instead we mark themsgpack_buffer_t
struct from the owner (packer or unpacker) mark function. This IMO is much cleaner, and allow us to no longer create theBuffer
instance eagerly for GC purposes. Given that accessing the buffer is a very rare use case, it is a bit wasteful.The second change is simply to remove
#dup
and#clone
on all the classes that never intended to have them defined. Closing buffer, packer or unpacker would copy the content of thestruct
, but that's a shallow copy so it might lead to leaks or use after frees etc.