go-datastore icon indicating copy to clipboard operation
go-datastore copied to clipboard

Provide Query Paramater to avoid copying Value's data?

Open kevina opened this issue 9 years ago • 1 comments

When NextSync() is used it is safe to avoid copying the Value's data. This will help mostly with go-ds-leveldb queries see https://github.com/libp2p/go-libp2p-kad-dht/issues/39.

@whyrusleeping Do you think this is a good idea? If this paramater is provided it will be an error to call either the Next() or Process() methods on the results.

kevina avatar Nov 23 '16 00:11 kevina

From IRC:

whyrusleeping: kevina: yeah, lets punt on doing the zero-copy values for now whyrusleeping: I definitely want that at some point, but lets not rock the boat too much here whyrusleeping: the reason i'm more hesitant on this one is that misuse of that feature can lead to some pretty subtle bugs

kevina avatar Nov 23 '16 00:11 kevina