自定义的分配器快速的std :: wstring的分配 [英] Custom allocator for fast std::wstring allocations

查看:172
本文介绍了自定义的分配器快速的std :: wstring的分配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有可以用的std :: wstring的被用来实施的快速的分配格局就像任何开源分配器(可能在升压)在这个博客帖子 <? / p>

Boost.Pool <一个href=\"http://stackoverflow.com/questions/10451585/using-vectorwstring-with-boost-pool-allocator\">doesn't似乎非常适合这一目的。


解决方案

没有,没有(我搜索了几个小时,一次)。如果你不小心使用过程中释放内存,它是相当简单的做自己。如果要动态地释放它,那么它就变成对自由列表管理,LRU等大量的工作。

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.

解决方案

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.

这篇关于自定义的分配器快速的std :: wstring的分配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆