Path: utzoo!attcan!uunet!decwrl!ucbvax!pasteur!agate!darkstar!saturn.ucsc.edu!sidney From: sidney@saturn.ucsc.edu (Sidney Markowitz ) Newsgroups: comp.lang.c++ Subject: Re: Turbo C++ Bummmer Message-ID: <5442@darkstar.ucsc.edu> Date: 25 Jul 90 22:43:50 GMT References: <9007230453.AA12697@ucbvax.Berkeley.EDU> <1990Jul24.212832.23427@cs.columbia.edu> Sender: usenet@darkstar.ucsc.edu Distribution: na Organization: University of California, Santa Cruz Lines: 31 In article <1990Jul24.212832.23427@cs.columbia.edu> kearns@cs.columbia.edu (Steve Kearns) writes: >I have a number of C++ files which will not compile because of >insufficient space. Even though I have 640K + 4 Meg of extended >memory. > >Turbo swaps out its CODE to extended memory or disk, but none of its >data. It's possible you have files which exceed the capacity of TC++, but it is more likely you have run into a glitch in the compiler. A large number of destructors for local variables and temporaries in a single block scope will cause the compiler to generate an out of memory error earlier than it should. You can tell if this is what you are running into, because compiling the file will still give you an out of memory error even if you comment out every function but one that contains the problem code. The workaround (until a fixed comes out) is to declare local variables that have destructors within a local {block} where they are used, and to surround expressions that generate temporary class instances (e.g., "foo" + "bar" where you have a string class that overloads + and has a conversion operator for const char *) with {}. The idea is to reduce the number of destructor calls within a single declaration scope. Of course you only have to do this in functions that have this problem. --sidney markowitz Disclaimer: I work for Borland (R&D), but I'm not speaking for Borland