Mail Archives: djgpp/1995/10/04/15:03:50
> 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 -