Date: Tue, 22 Oct 2002 21:51:27 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: Marcus Koch Message-Id: <2561-Tue22Oct2002215127+0200-eliz@is.elta.co.il> X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: <3DB57E77.57D69156@cityweb.de> (message from Marcus Koch on Tue, 22 Oct 2002 18:36:07 +0200) Subject: Re: memmory-problems with djgpp and cwsdpmi References: <3DB57E77 DOT 57D69156 AT cityweb DOT de> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Tue, 22 Oct 2002 18:36:07 +0200 > From: Marcus Koch > Newsgroups: comp.os.msdos.djgpp > > #include > #include > > int main() > { > unsigned long size; > char *pointer; > > size = _go32_dpmi_remaining_physical_memory(); > cout << "\n" << (unsigned long) size; > > pointer = (char *) malloc(1000000); > if(pointer == NULL) cout << "ERROR"; > > size = _go32_dpmi_remaining_physical_memory(); > cout << "\n" << (unsigned long) size; > } > > i get the following output: > > i:\prg\mwkdb\t2 > > 63602688 > 63594496 > > 1.) As you see it only consumes 8192 bytes of memmory but i requested > 1000000. > WHY WHY WHY ???? See section 15.2 of the DJGPP FAQ list, it explains this behavior.