[fpc-devel] TBits class bug?

Giuliano Colla giuliano.colla at fastwebnet.it
Fri Jan 25 14:08:49 CET 2008

Marco van de Voort ha scritto:
>> However FPC implementation makes inconsistent the values returned from 
>> OpenBit with those obtained reading Size.
>> Do I miss some point?
> I can imagine bits being allocated in words to avoid endianess problems. So
> it could be a deliberate deviation for portabilities sake.

That the implementation needs to be different to support different 
platforms I can understand. Delphi implementation uses asm code which 
make it i386 specific.

What I find harder to swallow is that a size of 31 is reported, when the 
allocated size is 1 and the available size is 32.

Current implementation makes it impossible to detect if an OpenBit has 
actually created a grow of the bitlist or not, which is necessary if the 
bitlist is used to keep track of other objects being allocated.

If nobody else is taking care of the matter, as I have a test case 
ready, I could try and fix TBits implementation, in oder to keep 
portability but to provide self-consistency, and submit a patch.

Kind regards,


Giuliano Colla

Whenever people agree with me, I always feel I must be wrong (O. Wilde)

More information about the fpc-devel mailing list