Mail Archives: djgpp/1996/02/09/14:35:52
> : Its a CWSDPMI bug. CWSDPMI ran out of memory zones (after around 3000
> : sbrk calls). This can be fixed by bumping the internal heap size.
> Is a program which does a lot of small malloc's likely to trigger this bug?
Maybe. The current distributed CWSDPMI can run up to around 200 memory zones
before returning 0 for the malloc() call. Since each memory zone is a
minimum of 64K, this would be around 13Mb of memory allocated in calls of
less than 32K each. Note that some other DPMI providers will have a similar
problem at around 16Mb, so you might want to consider fix 2/3 below.
There are few potential fixes:
1) ftp.neosoft.com:pub/users/s/sandmann/csdpmi1heapfix.zip contains a program
and explaination to work around this problem if you see it. Since noone
reported it in 2 months of beta'ing, I don't think this is a huge problem.
With the fix, you can probably go as big as you want.
2) #include <crt0.h> and then set the flag to use the unix sbrk algorithm if
you have the source. This will use a single resized zone, and there are
no limits.
3) Yet another bin-patch utility I have someplace, which modifies the sbrk()
algorithm for a DJGPP v2 image in the binary to be unix-style.
- Raw text -