delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/15/19:56:36

From: "Bernd König" <koenig AT physik DOT uni-wuerzburg DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Problem with ostrstream object
Date: Sat, 15 May 1999 17:33:06 +0200
Lines: 35
X-Newsreader: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
NNTP-Posting-Host: wpfd16.physik.uni-wuerzburg.de
Message-ID: <373d931a.0@uni-wuerzburg.de>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,
i found a problem with the ostrstream class (djgpp and gnu compiler under
Win95). Somewhere in
my program i have to create and remove an ostrstream object many times (i.e.
endless). It looks
like this:

#include <iostream.h>
#include <stdio.h>

void main()
{
while(1){
  {
   ostrstream *wandler = new ostrstream;
   wandler -> operator<<(10.0);
   wandler -> str();
   delete wandler;
  }
}
}


When running the program the system begins to swap until the error message:
Virtual memory exceeded in 'new'. I suppose that the memory for the object
is not realy released after deleting. Is it a bug in the c++ library or of
Win95? I'm thankful for your help.

B. Koenig






- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019