1.malloc函数
int* pi = (int*)malloc(sizeof(int)*1);
free(pi);
malloc->_nh_malloc_dbg->_heap_alloc_dbg->_heap_alloc_base->HeapAlloc
2.free函数
free->_free_dbg->_free_base->HeapFree
3.new关键字
int* pi = new int;
int* pk = new int(5);
Person* ps = new Person;
Person* pd = new Person(1,2);
第一步:_nh_malloc
->_nh_malloc_dbg
->_heap_alloc_dbg-
>_heap_alloc_base
->HeapAlloc
第二步:调用构造函数
4.delete关键字
delete pi;
delete pk;
第一步:调用析构函数
第二步:_free_dbg
->_free_base
->HeapFree
5.new[] 与 delete[]的用法
int* pi = new int[10];
delete[] pi;
Person* p = new Person[2];
delete[] p;