如何使用Loki的小对象分配器? [英] How do I use Loki's small object allocator?

查看:200
本文介绍了如何使用Loki的小对象分配器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Loki的小对象分配器,但我很困惑它如何工作。我已经阅读文档和许多论坛,但它没有意义:其中一些人说使用stl,其他人使用自定义分配器。我只需要能够测试其性能与分配和释放不同大小的对象。

I need to use Loki's small object allocator but I am very confused as to how it works. I've read the documentation and lots of forums but it doesnt make sense: some of them say to use the stl, others use custom allocators. I just need to be able to test its performance with allocating and deallocating objects of different sizes. Could someone please provide a small example of how to use it?

推荐答案

好的,最好的是让Loki的小对象分配器符合STL。为此,我只是为Loki中的SmallObjAllocator类创建了一个包装类,根据 http://www.codeproject.com/kb/cpp/allocator.aspx?fid=16541&df=90&mpp=25&sort=Position& tid = 1677312

Ok, best I got was to make Loki's Small Object Allocator compliant with the STL. To do this I just created a wrapper class for the SmallObjAllocator class in Loki according to http://www.codeproject.com/kb/cpp/allocator.aspx?fid=16541&df=90&mpp=25&sort=Position&tid=1677312

这篇关于如何使用Loki的小对象分配器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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