美文网首页
(1) SGI的Allocator分析

(1) SGI的Allocator分析

作者: 廿三万 | 来源:发表于2019-03-04 14:25 被阅读0次

C++标准的内存配置和释放动作:

class test{.....};
test* pt =new test;
//(1) 呼叫::opearator new 配置内存
//(2) 呼叫test::test()构建对象
delete pt;
//(1)呼叫test::~test()解构对象
//(2) 呼叫::opearator delete 释放内存

在sgi STL中:
内存配置--> alloc::allocator()
内存释放--> alloc::deallocator()
以上定义在alloc.h中

对象构建--> ::construct()
对象解构--> ::destroy()
以上定义在construct.h中


image.png

关于constrcut的实现点这里

相关文章

网友评论

      本文标题:(1) SGI的Allocator分析

      本文链接:https://www.haomeiwen.com/subject/ubtiuqtx.html