[comp.sys.ibm.pc] MSC 5.0 malloc

pcn (Phil Nelson) (06/24/88)

> From: jwg@duke.cs.duke.edu (Jeffrey William Gillette)
> Subject: When will Microsoft give us a *REAL WORLD* C Compiler
> Message-ID: <11622@duke.cs.duke.edu>
> Date: 21 Apr 88 01:03:02 GMT
>
> ... I discovered that malloc() was allocating storage right over 
> the top of uninitialized globals!  ...
>
> ... Probably a dozen UseNet aces have already pointed up the same 
> problem. ...
> 

As of June 23 Microsoft support claims complete ignorance of this
problem (large model, MSC5.0). Does anyone have any more details or
know of an 'official' or 'unofficial' fix?

I have a program that mallocs as much space as possible to maintain
its own disk cache. If I allow the cache to expand until malloc fails,
some static structures seem to get clobbered (menus start appearing in
random places etc). The program works fine if I limit the cache size
to a safe amount of memory ie. an amount known to be available. On
small data sets, I've had the cache cranked all the way to 128K
without a problem - but it always seems to be too late by the time
malloc fails.

If malloc insists on misbehaving, is there a clean way of determining
how much memory it should be allowed to dispense? (I could then
prevent any direct calls to malloc beyond that amount).

Any advice would be appreciated.

Philip Nelson
pcn@verity.com