[comp.sys.atari.st] Forty folders + Malloc.

t68@nikhefh.UUCP (Jos Vermaseren) (03/06/87)

The 40 folder limit turns out to be even more dangerous than we thought.
I have been able to crash on two folders!
The problem is a fixed 6000 bytes buffer from which all internal
allocations are taken. These allocations include:
A basepage for GEMDOS. ( 16 )
Drive information blocks. ( 3 ) + 3*( 4 )
Folder information blocks. ( 4 ) + ( 4 )
File information blocks. ( 4 )
Malloc information. ( 1 )
The numbers in parentheses represent the sizes of the blocks allocated.
For each size a separate pool is kept once a block is given. That is:
once a piece of memory is a block of ( 4 ), it can never be split in
smaller units. A block of size ( i ) occupies 16 * i + 2 bytes.
By malloccing a lot I allocated everything in units of ( 1 ). My next file
operation spoiled my RAM disk ( I am not trying things like this with my
hard disk ). The only 'folders' used were A: and D: !
The address at which ( at least in my ROMS ) the size of the available
memory ( in units of two bytes ) is kept is $5FDE. Keep an eye on it!
The reason that it is called a forty folder limit has mainly to do with
the fact that after closing a folder its entry doesn't get taken from the
list, so until its drive is dismounted, or the folder is deleted it will
keep occupying its space. Having been inside ( roughly ) 40 folders that
are all still in the system ( like on hard disk ) is the most common way
to run into problems, but using Malloc may lower the 40 considerably.
Users of Lattice C don't have this Malloc problem, as lattice doesn't
allow the usage of the GEMDOS Malloc.

Given these problems I don't believe there exists a 'quick hack' to really
solve these limits. The only solution is a rewrite of all internal memory
routines of GEMDOS. I understand that Atari is trying that at the moment.

----------------------------------------------------------------------------
How many DRI types does it take to replace a light bulb?
That too difficult for them. As a kludge they will try to sell you a candle.
----------------------------------------------------------------------------