Re: [Dev-C++] memory allocation with STL list
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ho...> - 2003-02-19 18:51:00
|
It shouldn't remain allocated after the end of f()'s execution. If it doe= s, it is a compiler bug. What made you think it remains allocated?=0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys =0D =0D =0D -------Original Message-------=0D =0D From: Pablo=0D Date: =D4=E5=F4=DC=F1=F4=E7, 19 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 7:= 30:30 =EC=EC=0D To: dev...@li...=0D Subject: [Dev-C++] memory allocation with STL list=0D =0D I have a problem with the list template from the STL, illustrated in the following simple code:=0D =0D #include <iostream>=0D #include <stdlib.h>=0D #include <list>=0D using namespace std;=0D =0D void f()=0D {=0D list<double> l;=0D for (int i=3D0; i<1000000;i++) l.push_back(i);=0D }=0D =0D int main()=0D {=0D f();=0D system("PAUSE");=0D return 0;=0D }=0D =0D The code compiles and runs ok with Dev C++, but the problem is that the memory used by the list remains allocated, even when the object is no lon= ger accessible (at the "pause" prompt). =0D This does not happen with other STL templates (deque, vector,...) under D= ev C++, neither with lists under Borland compilers.=0D Does anyone know how to address this?=0D Thanks in advance for your help.=0D =0D =20 |