delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/05/19:01:27

From: Andreas Dorn <adornno1 AT web DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Large Arrays
Date: Fri, 06 Jul 2001 00:42:54 +0200
Organization: University of Heidelberg, Germany
Lines: 19
Message-ID: <3B44ED6E.E3EDD428@web.de>
References: <3B447193 DOT E7BA25AB AT ix DOT urz DOT uni-heidelberg DOT de> <9i1vcr$8op$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: ppp304.urz.uni-heidelberg.de
Mime-Version: 1.0
X-Trace: news.urz.uni-heidelberg.de 994372911 3644 129.206.203.104 (5 Jul 2001 22:41:51 GMT)
X-Complaints-To: usenet AT news DOT urz DOT uni-heidelberg DOT de
NNTP-Posting-Date: 5 Jul 2001 22:41:51 GMT
X-Mailer: Mozilla 4.7 [de]C-CCK-MCD CSO 1.0 (Win95; I)
X-Accept-Language: de,en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hans-Bernhard Broeker wrote:
> Andreas Dorn <adorn AT ix DOT urz DOT uni-heidelberg DOT de> wrote:
> > I need a really large array for a matrix (~100 MB).
> 
> Fine. But you should re-think the way you're using to create it.
> 
> [.. inside main(): ..]
> >   float TheMatrix[Dimension][Dimension];
> 
> This creates the matrix in the stack. That's bad, because the stack
> has a fixed maximal size, on DOS/DJGPP (and several other platforms).
> Use the heap, instead (--> 'new' or 'malloc'). Methods for creating 2D
> dynamical arrays that still can be accessed by a[i][j] notation are in
> the comp.lang.c FAQ.

Thank you for the hint. I re-arranged the Matrix definition and now
everything works fine.

Andreas Dorn

- Raw text -


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