Mail Archives: djgpp/1999/07/14/20:05:15
From: | salomon AT uni-wuppertal DOT de (Winfried Salomon)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | malloc() and CWSDPMI 4.0
|
Date: | Wed, 14 Jul 1999 15:34:21 GMT
|
Organization: | University of Wuppertal
|
Lines: | 27
|
Message-ID: | <378bbab9.22414525@news.uni-wuppertal.de>
|
NNTP-Posting-Host: | isdn27.dialin.uni-wuppertal.de
|
X-Newsreader: | Forte Free Agent 1.11/32.235
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Hello people,
I am a beginner with GNU-compilers and with C and I have a problem
with malloc(), the compiler is GNU C 2.81 under Win98. My program
should test the XMS-memory under DOS 7.10, so I got CWSDPMI 4.0 to
allocate up to 256 MB XMS-Ram.
There are 2 problems: First I donīt find a function to get the
greatest *physical* coherent memory block, so I use malloc() with the
method of successive approximation, to find the biggest amount by
testing if the returned pointer is valid or not. So far so bad, the
second problem: With 96 MB Ram I allocate 128 MB + 4 KB blocksize! How
can this be?
I also wonder that I can run malloc() without CWSDPMI, but only with
64 MB + 4 KB maximum blocksize. How can I allocate precise the
availible XMS-Ram?
An adjacent question is, how could I combine GNU Fortran77 0523 with
GNU C 2.81, because I have source in Fortran from another machine. The
disadvantage of GNU Fortran is the bad dokumentation and the problems
with hardware access, there is no malloc() or such thing.
BTW: I donīt know very much about the memory mangement of DOS.
Greetings, Winfried
- Raw text -