You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to transfer ownership back and forth between a immutable data container and IOBuf. The container maintains contiguous segments of memory allocated using std::malloc. The data structure has a method reset that takes ownership of the provided uint8_t pointer and the given length of memory. I've tried the following code, which causes a segfault. The IOBuf is not chained and is stored in a unique_ptr. Is there a standard way of releasing ownership of the underlying data in IOBuf?
I'm not sure you can get IOBuf to release its underlying buffer, but you can construct one wrapping a buffer that you own (so it won't delete it at destruction time). See IOBuf::wrapBuffer.
I need to transfer ownership back and forth between a immutable data container and IOBuf. The container maintains contiguous segments of memory allocated using std::malloc. The data structure has a method
reset
that takes ownership of the provided uint8_t pointer and the given length of memory. I've tried the following code, which causes a segfault. The IOBuf is not chained and is stored in a unique_ptr. Is there a standard way of releasing ownership of the underlying data in IOBuf?The text was updated successfully, but these errors were encountered: