[fpc-devel] sub byte arrays

Alexander Klenin klenin at gmail.com
Thu Jul 22 15:47:00 CEST 2010


On Wed, Jul 21, 2010 at 03:04, theo <xpde at theo.ch> wrote:
> José Mejuto wrote:
>> Had you tried SizeOf(TTestarray) ?
>
> Good idea. Now I can see that the theory is right.
> for: TTestarray = array [1..100] of ttest;
> It goes down from 400 to 25 (using bitpacked).
>
> Jonas Maebe wrote
>> Uses new(lMask) instead, then the compiler will automatically allocate
> the right size for you.
>
> I don't think this is going to solve my problem.
> I need to define the size at runtime.
> With
> getmem(lMask, (Elements div 4) +1);
> this should be possible, right?
>

BTW, I think that bitpacked should be extended to support
dynamic arrays -- it would be useful for bit vectors, for example.

-- 
Alexander S. Klenin



More information about the fpc-devel mailing list