cpp-ipc icon indicating copy to clipboard operation
cpp-ipc copied to clipboard

请问为何不提供loan的接口

Open thun-res opened this issue 1 year ago • 2 comments

大佬你好~,ipc::sender为何不提供类似loan的接口,很多情况下可以减少一次拷贝: 就比如protobuf的序列化,通过调用SerializeToArray,直接把buffer指定到共享内存块上,这样可以省去一次从用户的内存搬运到共享内存的过程

thun-res avatar Aug 18 '24 06:08 thun-res

嗯,最开始设计的时候主要针对的是小内存,因此ipc内部的内存管理并没有作为通用接口开出来。但你说的这个点是有道理的,所以在重构分支里我会想办法把内存申请接口给出来,减少一次深拷贝

mutouyun avatar Aug 21 '24 15:08 mutouyun

感谢回复,期待重构后的版本

thun-res avatar Aug 22 '24 11:08 thun-res