2011年9月8日

Herm的Allocator介绍

摘要: Allocator可以理解特定对象池。Herm目前有两种Allocator,LiteAllocator和LargeAllocator,前者支持小于120bytes的小对象;后者支持大对象,建议大于120byte以上的对象使用LargeAllocator,小对象当然也支持,但会浪费内存,每个对象将附加8bytes的内存空间。STL也可以直接用Herm的Allocator作为Allocator。LiteAllocator 在Linux其实就是__gnu_cxx::pool_alloc, Windows上直接弄成std::allocator,因为Herm的定位是开发Linux&FreeBSD 阅读全文

posted @ 2011-09-08 16:58 daemonh 阅读(171) 评论(0) 推荐(0) 编辑

导航