www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/05/10:30:04

From: Andreas Dorn <adorn AT ix DOT urz DOT uni-heidelberg DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Large Arrays
Date: Thu, 05 Jul 2001 15:54:27 +0200
Organization: University of Heidelberg, Germany
Lines: 41
Message-ID: <3B447193.E7BA25AB@ix.urz.uni-heidelberg.de>
NNTP-Posting-Host: aixterm0.urz.uni-heidelberg.de
Mime-Version: 1.0
X-Trace: news.urz.uni-heidelberg.de 994341268 9153 129.206.119.40 (5 Jul 2001 13:54:28 GMT)
X-Complaints-To: usenet AT news DOT urz DOT uni-heidelberg DOT de
NNTP-Posting-Date: 5 Jul 2001 13:54:28 GMT
X-Mailer: Mozilla 4.61 [en] (X11; I; AIX 4.2)
X-Accept-Language: de
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

My problem:
I need a really large array for a matrix (~100 MB).
With linux/unix and gcc that worked fine, but with dos/windows this
never worked. Even with 256MB RAM and "small" arrays (<5MB) it didn't
work.

The initialisation of the array looks like this:

int main(void)
{
  const int Dimension=5000;

  float TheMatrix[Dimension][Dimension];
  int i,j;

  for(i=0; i<Dimension; i++){
    for(j=0; j<Dimension; j++){
      TheMatrix[i][j]=0.0;
    };
  };

  return(0);
}

For example Dimension=300 works fine on my computer(32MB-RAM,win95).
Dimension=600 compiles with djgpp and crashes when executed.

My questions:
- I don't have much experience with dos/windows compilers. What is the
reason for the memory-problems? And how much memory do I get for an
array under win3.11, win95, ..?

- Is there an easy solution (a compiler option or something) to get a
working array?  (option: -WA <working array> :-))

- Will it work, if I try to allocate the memory for the array myself
(...writing my own array class), or is there a fundamental problem?

Help welcome.

Andreas Dorn

- Raw text -


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