www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/02/03:01:13

Date: Thu, 2 May 1996 09:48:56 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Ansel Sermersheim <agserm AT netwizards DOT net>
Cc: djgpp AT delorie DOT com
Subject: Re: V2 vs. 1.12m5
In-Reply-To: <4m5nlb$cib@news.wco.com>
Message-Id: <Pine.SUN.3.91.960502094102.6400O-100000@is>
Mime-Version: 1.0

On Tue, 30 Apr 1996, Ansel Sermersheim wrote:

> I also have to use the unix sbrk algorithm (until I write my own heap
> functions).  It's not a problem, it seems to work fine.  However, I'd like
> t know what tradeoff I'm making.  Is malloc() slower under the unix sbrk?
> Does it take more memory for housekeeping? There's gotta be a catch!

There is a catch, all right.  In fact, there are few of them:

	1) Under some DPMI hosts (notably, QDPMI, except in the latest 
versions) you will be effectively denied virtual memory when using unixy 
sbrk algorithm (i.e., you can only allocate memory as much as you have 
physically free).

	2) You shouldn't use it in programs that install their own 
hardware interrupt handlers (because there is a small window of time when 
a hardware interrupt can crash your system when you use unixy sbrk).

	3) Support for `nearptr' access to memory-mapped hardware is more
tricky (and thus can have more bugs, although none are known at this
time). 

The facts that most (all?) the other protected-mode environments use the 
default (non-unixy) algorithm should tell something.

- Raw text -


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