delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/14/04:18:09

From: Bryan |stergaard <bryan AT diku DOT dk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP <->Linux-GCC - question
Date: Mon, 13 Jan 1997 19:33:48 +0100
Organization: Department of Computer Science, U of Copenhagen
Lines: 39
Sender: bryan AT embla DOT diku DOT dk
Message-ID: <Pine.HPP.3.95.970113192808.13116I-100000@embla.diku.dk>
References: <5bcktj$b10_001 AT tuwien DOT ac DOT at> <5bd5rj$5r AT utcnews DOT utc DOT fr>
NNTP-Posting-Host: embla.diku.dk
Mime-Version: 1.0
In-Reply-To: <5bd5rj$5r@utcnews.utc.fr>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On 13 Jan 1997, Fabrice Premel wrote:

> godzilla (e8725229 AT stud1 DOT tuwien DOT ac DOT at) wrote:
> : Hi !
> : i ask this just out of couriosity,but hope there is an answewr nonetheless.
> : i've programmed quite a lot of numerical stuff using DJGPP and now i've 
> : switched to Linux - gcc and under linux i can allocate much more memory then 
> : with DJGPP under DOS -> why??
> : to make it clearer:
> : i declare e.g. 10 fields (doubles) with NP components.
> : in DJGPP thep program compiles without any warning, but i get a segmentation 
> : fault already if NP = 5000.
> : under Linux i let NP be 100000 and the program works fine [it just takes a lot 
> : of tim to run :-) ]
> : if it matters: i have a Pentiom 133 with 32 MB RAM.
> : thanks for any answers
> : greetings 
> : godzilla
> 
> --
> Maybe you've got a swap under Linux ?
> I don't think that djgpp can handle disk swaps, but linux can.
> don't know if is the solution, but i tried ...
> 
> 							F.
> 

Nope, this isn't it. Under Linux, as any UNIX I know of, physical memory
aren't malloc'ed the same way DOS does. For example you should be able
to alloc 100 megs, allthough you only got 8 mb memory. (physical + swap)
The actual memory is only mapped in if you use it.

So to take account of dynamic data, which size you don't know beforehand,
you can just allocate a couple megs, and use it as data becomes available.

So this mapping process is the key to the difference.

Btw. cwsdpmi can handle virtual memory.

- Raw text -


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