Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

parsefrom(Bytebuf) is unsafe #3

Open
cbornet opened this issue Dec 23, 2020 · 1 comment
Open

parsefrom(Bytebuf) is unsafe #3

cbornet opened this issue Dec 23, 2020 · 1 comment

Comments

@cbornet
Copy link

cbornet commented Dec 23, 2020

Very nice initiative ! I'll have a look at how to integrate into gRPC and use it in Pulsar-gRPC

Since parseFrom does zero-copy, I understand that the Bytebuf passed as argument must not be released as long as the deserialized object may be used. So the name of the operation should probably reflect that? For instance, the classic protobuf lib uses the name unsafeWrap (in UnsafeByteOperations). WDYT ?

@aahmed-se
Copy link
Contributor

We may to wrap the buffers with agrona

https://dzone.com/articles/agronas-threadsafe-offheap

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants