X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Mon, 11 Mar 2002 13:07:31 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Giovanni Spagnuolo cc: djgpp AT delorie DOT com Subject: Re: new[] and delete[] In-Reply-To: <79246c4b8f87891fe4ac8972a90fb6a1.76722@mygate.mailgate.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 11 Mar 2002, Giovanni Spagnuolo wrote: > cout<<"before allocation"< cout<<_go32_dpmi_remaining_physical_memory()< cout<<_go32_dpmi_remaining_virtual_memory()< > int * v = new int[N]; > > cout<<"after allocation"< cout<<_go32_dpmi_remaining_physical_memory()< cout<<_go32_dpmi_remaining_virtual_memory()< > delete [] v; > > cout<<"after disallocation"< cout<<_go32_dpmi_remaining_physical_memory()< cout<<_go32_dpmi_remaining_virtual_memory()< > return 0; > } > > Nevertheless it seems that the disallocated memory does not become newly > free. See section 15.2 of the DJGPP FAQ list, it explains why this is expected behavior. What are you trying to accomplish, really? Since this is a toy program, I assume you have something more serious in mind; if you tell what that is, perhaps someone can suggest a solution.