🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #32129

Re: Big arrays in C

#32129
From: Barnacle Wes
Date: Sun, 24 Apr 1988 07:30
30 lines
1984 bytes
In article <791@sun.mcs.clarkson.edu>, mrd@sun.mcs.clarkson.edu (Michael R. DeCorte) writes:
> Does the new version of MWC support arrays > 64K.  I have an older
> version (? 2.- ?) and it seems to get fairly upset at large arrays.
> If not, do any of the compilers have large arrays or am I going to be
> forced to hack the output of TeX-to-C?

Yes, MWC 3.0 will support arrays > 64K, and yes, MWC 2.1.7 already
supports arrays > 64K.  The same limitation applies to both: the array
MUST be either static or global (static data either way).

The reason for this is simple: the MWC compiler uses the `link'
instruction to allocate space for the auto variables from the stack.
On the 68000, the link instruction takes a signed 16-bit integer as the
stack offset to use.  Thus, the link instruction can allocate a maximum
of 32K of space for auto variables.  Thus the true array size
limitation is not really even 64K, it is 32K.

The compiler will complain about `strict: array size exceeds size_t',
but this is a `strict' message, which you can safely ignore.  It's
just telling you there is something you should check and make sure you
are doing what you really want to do.

Don't complain too much about making the arrays static, just think -
the MS-DOS world really can't get around their 64K limitation at all
without some truly WEIRD machinations.
-- 
    /\              -  "Against Stupidity,  -    {backbones}!
   /\/\  .    /\    -  The Gods Themselves  -  utah-cs!uplherc!
  /    \/ \/\/  \   -   Contend in Vain."   -   sp7040!obie!
 / U i n T e c h \  -       Schiller        -        wes
Technical Details
Message-ID: <169@obie.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-tis!oodis01!uplherc!sp7040!obie!wes
References: <791@sun.mcs.clarkson.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-tis!oodis01!uplherc!sp7040!obie!wes
From: wes@obie.UUCP (Barnacle Wes)
Newsgroups: comp.sys.atari.st
Subject: Re: Big arrays in C
Message-ID: <169@obie.UUCP>
Date: 24 Apr 88 07:30:19 GMT
References: <791@sun.mcs.clarkson.edu>
Organization: the Well of Souls
Lines: 29
Summary: Large arrays in MWC 2.x