gaodayue commented on issue #2075: Segment v2 stream load core dump(#2037) URL: https://github.com/apache/incubator-doris/pull/2075#issuecomment-547279244 > This is an option. But if we use adopt it, user can call finish only one time. I'm not sure if it is convenient for all use scenarios. I can't think of any use case for the client to call `finish` more than once before `reset`. The proposed method can be implemented very efficiently almost without memory copy ``` OwnedSlice finish() { Slice slice(_buffer); slice.data = (char*) _buffer.release(); return OwnedSlice(slice); } ``` > This way means PageBuilder always release its page and use OwnedSlice to maintain returned page? Yes. > If so,faststring's optimization is useless,because whether array grow happens,it always return a array using new to allocate `faststring` is not only used by `PageBuilder`, so in other places the small buffer optimization can be useful.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
