:can anybody enlighten me why this was done in the first place?
:this way it's much clearer anyways
:
:cheers
: simon
To be clean. The original code was designed to be optimal for,
um, VAX computers at the cost of being considerably less readable
by using a array of pointers (scaling factor x4 for the array lookup)
for the most common operation (a file pointer lookup). The second
array of chars to store the file flags (scaling factor x1 for the array
lookup), in order to avoid a structure of 6 bytes and having to do a
multiply by 6 to look up an entry in the array. Back then space was
at a premium.
Now we have a file pointer (4 bytes), flags (1 bytes), and allocation
count (4 bytes) = 9 bytes. Since space is not at a premium I just made
it 12 bytes and a multiply is used for the array lookup.
If we care more about performance we could make it 16 bytes so the array
lookup is scaled by a factor of two again, which I might just do actually
because that removes the overhead of a multiply.
-Matt