Custom allocator for fast std::wstring allocations

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 17:32:42

问题


Is there any open-source allocator (possibly in Boost) that can be used with std::wstring implementing a fast allocation pattern like the one showed in this blog post?

Boost.Pool doesn't seem well suited for this purpose.


回答1:


No, there isn't (I searched for a couple of hours, once). If you don't care to release memory during usage, it is fairly simple to do yourself. If you want to release it dynamically, then it becomes a lot of work regarding free list management, LRU, etc.



来源:https://stackoverflow.com/questions/10462806/custom-allocator-for-fast-stdwstring-allocations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!