[fpc-devel] dominant short strings in compiler source

Vincent Snijders vsnijders at quicknet.nl
Tue May 16 23:20:13 CEST 2006


L505 wrote:
>>well it would have to have a different in memory format. Maybe a -1 based
>>array with the first two locations used for length would do it.
> 
> 
> Add new types that extend the 255 limit, using more bytes for storage to double and even
> triple our current 255 limit.

I think once there existed something longstring with max len 2^16-1.
> 
> QShortString: 255 X 4 with 4 bytes used to store the length
maxlen: 2^32-1
> TShortString: 255 X 3 with 3 bytes used to store the length
maxlen: 2^24-1;
> DShortString: 255 X 2 with 2 bytes used to store the length
maxlen: 2^16-1
> 
> var
>   qss: QuadShortString[1020]; // why not use DoubleShortString ?
>   tss: TripleShortString[765];
>   dss: DoubleShortString[510];
>   ss: ShortString[255];

Vincent.



More information about the fpc-devel mailing list