delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/24/13:24:27

Xref: news2.mv.net comp.os.msdos.djgpp:576
From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Dyn Mem Allocation using new and delete in dgjpp g++
Date: Tue, 23 Jan 1996 14:00:52 -0800
Organization: &tSftDotIotE
Lines: 23
Message-ID: <31055A94.46587DB3@alcyone.com>
References: <0099CD07 DOT 29EC49B7 AT vms DOT csd DOT mu DOT edu>
NNTP-Posting-Host: 206.14.39.81
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Richard W. Kelnhofer wrote:

> I created a class in c++ to implement interval numbers and vectors
> of interval numbers.  The vector class uses new and delete in
> the constructors and destructors to allocate and deallocate memory
> from the free store.  This works well on most platforms.  However,
> I was getting segmentation violations when running code compiled
> with djgpp on a PC.  I solved the problem by placing the implementation
> code for the constuctors and destructors inside the class definitions.

Huh?  Where else would one put the constructors and destructors?  Do you mean
you fixed them by making them inline?

If you find crashes on some platforms and not others, it probably implies some
sort of draft standard C++ violation that you're doing which is subtle enough
so that some compilers crash while others don't.

-- 
Erik Max Francis, &tSftDotIotE. && max AT alcyone DOT darkside DOT com || max AT alcyone DOT com
San Jose, California, U.S.A. && 37 20 07 N 121 53 38 W && the 4th R is respect
H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- && 1love && folasade
Omnia quia sunt, lumina sunt. && GIGO Omega Psi && http://www.alcyone.com/max/
"Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_

- Raw text -


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