C++標(biāo)準(zhǔn)的內(nèi)存配置和釋放動作:
class test{.....};
test* pt =new test;
//(1) 呼叫::opearator new 配置內(nèi)存
//(2) 呼叫test::test()構(gòu)建對象
delete pt;
//(1)呼叫test::~test()解構(gòu)對象
//(2) 呼叫::opearator delete 釋放內(nèi)存
在sgi STL中:
內(nèi)存配置--> alloc::allocator()
內(nèi)存釋放--> alloc::deallocator()
以上定義在alloc.h中
對象構(gòu)建--> ::construct()
對象解構(gòu)--> ::destroy()
以上定義在construct.h中

image.png
關(guān)于constrcut的實現(xiàn)點(diǎn)這里