ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/02/05/11:29:57

Date: Wed, 5 Feb 92 09:05:19 EST
From: DJ Delorie <dj AT ctron DOT com>
To: abentley%peruvian AT cs DOT utah DOT edu
Cc: ressler AT cs DOT cornell DOT edu, djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Bootstrapping djgpp
Status: O

>    Hey all you.  I can see you.

Funny, we've never transmitted any pictures :-)

>    Well, anyway, I was curious how malloc() and calloc() get memory
>from the heap.  Was this difficult for you, or did you let the guy who
>wrote gcc do most it?  I don't need to know exactly how, but just a sort of
>lay man's type of explanation.  

The standard malloc() algorithm is to use sbrk() to expand the linear
memory space it has access to, then maintaining information about how
it's divvied into chunks for the program.  The sbrk() call is usually
an OS call, even in go32, which adjusts the MMU to grant access to
more memory.  The malloc() in djgpp is directly from the BSD sources,
without modification.

DJ
dj AT ctron DOT com
Life is a banana.

- Raw text -


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