随笔分类 -  STL学习

摘要:关于STL 中allocator的接口与实现,C++标准有比较清楚的定义:http://en.wikipedia.org/wiki/Allocator_(C%2B%2B)关于STL的allocator的标准接口阐述,可阅读另外一篇转载文章:allocator1. SGI STL版本的allocator并没有遵守C++标准。它只提供simple_alloc类共container使用,设计的allocator名字叫做alloc,有二级配置器。第一级配置采用malloc/free来实现allocate/deallocate,第二级配置器采用针对申请的内存有特别处理,如果大小大于128字节,则转调用第 阅读全文
posted @ 2012-06-17 12:05 Zero Lee 阅读(2013) 评论(1) 推荐(1)
摘要:Allocators are one of the most mysterious parts of the C++ Standard library. Allocators are rarely used explicitly; the Standard doesn't make it clear when they should ever be used. Today's allocators are substantially different from those in the original STL proposal, and there were two oth 阅读全文
posted @ 2012-06-17 11:28 Zero Lee 阅读(705) 评论(0) 推荐(0)