delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/09/14/19:43:02

Date: Mon, 14 Sep 92 19:10:23 EDT
From: DJ Delorie <dj AT ctron DOT ctron DOT com>
To: pynq AT midway DOT uchicago DOT edu
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Is there a limit on the size of automatic variables?

>I.e., how big is the stack?

>was very big indeed.  Now, this is all just screwing around, but I do
>wonder just how much stack one is allowed to allocate...

The stack grows down from 0x7ffffffc.  It can grow down to 0x40000000
before go32 thinks you're trying to access the heap illegally.  Thus,
there is a maximum of just short of 1 Gb of stack.  However, there is
a maximum of 128 Mb of swap space, and only so much physical memory.
Thus, the maximum space your program (code+data+heap+stack) can take
up is physical + swap.

Note that go32 uses an allocate-on-demand method of paging, so you can
set up a 1 Gb data structure on the stack and it will work just fine
as long as you don't try to *access* the data.  Sparse arrays are
*real* easy with go32 - just declare them, and go32 will only allocate
pages for memory you write to or read from.

>And, what will happen if it is too big?

If you use too many physical pages, and swap space is full, you will
either get a "disk full writing to swap file" or a "out of swap space"
message.

DJ
dj AT ctron DOT com
Life is a banana.


- Raw text -


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