| Author |
what happen to heap on programme exit
|
|
| apple.davinci 2005-12-18, 8:49 pm |
| such as
int main()
{
char * p = new char[44];
char * p1 = new char[33];
p=p1;//memory leak
//and I did't free.
}
what will happen to the heap section when I exit the programme.
| |
| Måns Rullgård 2005-12-19, 2:49 am |
| "apple.davinci" <apple.davinci@gmail.com> writes:
> what will happen to the heap section when I exit the programme.
The OS will reclaim it for use by other processes.
--
Måns Rullgård
mru@inprovide.com
| |
| Pascal Bourguignon 2005-12-19, 2:49 am |
| "apple.davinci" <apple.davinci@gmail.com> writes:
> such as
> int main()
> {
> char * p = new char[44];
> char * p1 = new char[33];
>
> p=p1;//memory leak
> //and I did't free.
>
>
> }
>
>
> what will happen to the heap section when I exit the programme.
It is garbage collected by the OS.
--
__Pascal Bourguignon__ http://www.informatimago.com/
Grace personified,
I leap into the window.
I meant to do that.
|
|
|
|