realloc以后,原有内存被如何处理? 回收? 释放? 不管?
摘要:
如果已分配的存储块后面有空闲的空间,则realloc不会移动数据而只是增加原来存储块的长度,并返回传给它的原存储块的指针。但当前存储块后面没有足够的空闲空间时,realloc会重新分配一存储块,并移动当前存储块的内容到新块,然后返回新块的指针。realloc() changes the size of the memory block pointed to by ptr tosize bytes. The contents will be unchanged to the minimum of the oldand new sizes; newly allocated memory will 阅读全文
posted @ 2014-01-15 14:54 yuanqing 阅读(1514) 评论(0) 推荐(0)
浙公网安备 33010602011771号