www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/22/17:35:55

From: Robert Hoehne <Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: mem alloc taking up power of 2
Date: Fri, 18 Jul 1997 13:06:52 +0200
Organization: TU Chemnitz-Zwickau
Lines: 22
Message-ID: <33CF4E4C.55AC6B25@Mathematik.TU-Chemnitz.DE>
References: <199707171548 DOT IAA02022 AT adit DOT ap DOT net>
NNTP-Posting-Host: pandora.hrz.tu-chemnitz.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Nate Eldredge wrote:
> 
> AFAIK, no you don't. malloc uses sbrk to get memory from the DPMI server. It
> gets *that* memory in powers of 2 to reduce overhead, but then parcels it

That's correct.

> out to malloc calls as it's needed. So each structure should just be using a
> 34K block, it's just that malloc grabbed some extra which will be given to
> the next request.

But that's NOT correct. malloc() returns also the power of two aligned
block to the user.

Robert
-- 
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post:    Am Berg 3, D-09573 Dittmannsdorf                     *
* e-Mail:  Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE              *
* WWW:     http://www.tu-chemnitz.de/~rho                       *
*****************************************************************

- Raw text -


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