Mail Archives: djgpp/1996/05/02/03:01:13
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 -