|
From: Ioannis V. <no...@ho...> - 2002-07-04 18:43:52
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Daniel Glenfield
> Sent: Thursday, July 04, 2002 3:37 PM
> To: jav...@ci...; dev...@li...
> Subject: Re: [Dev-C++] Memory
>
>
> Ok I'm a little lost...
> you can't destroy classes, only instances of classes
> (objects). If you
> destroy the object the memory is released - I assume by
> "losing memory" you
> mean memory is not deallocated i.e. made available.
>
> does anyone know if it is possible to allocate X memory for
> an application
> and only let it use that much? I'm thinking that X MB of
> memory could be
> allocated then at the end of the program check to see if it
> is all available
> again.
>
> like if ( CurrentMem == InitialMem )
> {
> cout << "Memory has been managed perfectly.";
> }
There is no need for such mess in the first place. Use the standard
library containers instead of manually allocating and deallocating
memory, and using built in arrays. For normal situations use the
standard library vector.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|