This shouldn't need to do any byte allocation. We just want ptr to point to the right place in an already allocated buffer (that conforms to your array serialization format).