Mail Archives: djgpp/1997/01/14/04:18:09
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 -