www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/10/04/15:03:50

Xref: news-dnh.mv.net comp.os.msdos.djgpp:2393
Path: news-dnh.mv.net!mv!news.sprintlink.net!news.oz.net!news.worldcom.com!news.sesqui.net!rice!news!sandmann
From: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: More on malloc
Date: Wed, 04 Oct 1995 07:55:40 CDT
Organization: Rice University, Houston, Texas
Lines: 23
References: <44rh0p$nkr AT grok DOT provo DOT novell DOT com> <44s260$9fn AT magus DOT cs DOT utah DOT edu> <Pine DOT SUN DOT 3 DOT 90 DOT 951003110651 DOT 4442G-100000 AT amon DOT cs DOT odu DOT edu> <44ssb4$aru AT ixnews3 DOT ix DOT netcom DOT com>
Reply-To: sandmann AT clio DOT rice DOT edu
Nntp-Posting-Host: clio.rice.edu
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

> Is the default djgpp malloc also in C++?  I haven't noticed any
> slowdown, possibly the _one_ time swap-in (or is it optimized to be
> only swap-out for new memory?) is so fast I can't see any flicker from
> GO32's status or hear any drive noise.  I have my code parameterized

Under V1.x under GO32 memory control, the zeroing is done the first time
a page is touched, and only committed at that time.  So the extra memory
allocated by malloc() would not cause any extra paging in that case, but
you are still potentially limited in the amount you can malloc by this
factor of two roundup.

Under V1.x under DPMI memory control, the zeroing is done at allocation
time, so can cause lots of extra paging.

Under V2.x (always DPMI) memory is not zeroed (unless requested) so
acts very much like V1.x w/o DPMI as far as performance.

> Is this a penalty for trying to use ANSI C89 standard calls?  I don't
> remember sbrk as one of them.

No, malloc calls sbrk to get it's memory.  There is no special penalty
for using ANSI calls.  The default malloc is designed for maximum speed
of calls and not optimal memory usage.

- Raw text -


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