🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #3362

Re: **HELP** Memory Allocation

#3362
From: Peter Moylan
Date: Mon, 11 Mar 1996 23:04
32 lines
1997 bytes
Ross & Mandy (Ross&Mandy@sinex.demon.co.uk) wrote:

>For various reasons, I need to extend my data area beyond 64K 
>in Topspeed Modula-2 V3. Does anyone know how to do this? I 
>have tried near and far allocations with no joy. 

If you're talking about the total data area then this is
easy - just use the XLarge memory model - but I guess you've
already tried this.  If you're talking about the total
static data space used by one module, then the solution is
to break the module into smaller modules.

But if you're talking about the size of a single array,
you're most likely in trouble.  Even if you could allocate
the space, how could you fit an array subscript into a
16-bit CARDINAL?  From memory, I don't think TopSpeed allows
LONGCARD subscripts, and even the OS/2 version of TopSpeed
still uses 16-bit arithmetic.  (This might have changed in
the Clarion version, I don't know.)  If you absolutely must
use 32-bit subscripts, you probably need another compiler.

The real question to ask, I think, is: do you really need to
organise your data into a huge array?  Once you start using
huge static data structures you tend to run into other problems,
for example efficiency-related problems.  Most problems of this
kind can be solved by better design of the data structures.

--
Peter Moylan                           peter@ee.newcastle.edu.au
                  http://www.eng.newcastle.edu.au/ee/Moylan.html
OS/2 freeware list at 
      http://www.eng.newcastle.edu.au/ee/Moylan/os2/os2info.html
Technical Details
Message-ID: <4i2bia$f9e@seagoon.newcastle.edu.au>
Path: arc1-ca.pugleaf.net!fourier.newcastle.edu.au!peter
References: <31402188.A79@sinex.demon.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!fourier.newcastle.edu.au!peter
From: peter@fourier.newcastle.edu.au (Peter Moylan)
Newsgroups: comp.lang.modula2
Subject: Re: **HELP** Memory Allocation
Date: 11 Mar 1996 23:04:42 GMT
Organization: The University of Newcastle
Message-ID: <4i2bia$f9e@seagoon.newcastle.edu.au>
References: <31402188.A79@sinex.demon.co.uk>
Reply-To: peter@tesla.newcastle.edu.au
NNTP-Posting-Host: fourier.newcastle.edu.au
X-Newsreader: TIN [version 1.2 PL2]