Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-10

TFPList.Pack

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Peter Vreman
to Micha Nelissen
Show quoted text 8 lines
Micha Nelissen wrote: > Hi, > > , is this correct ? Shouldn't it be FList^, since FList > is a pointer to an array of pointers ? Sorry, fpc 2.1.1, compiler/cclasses.pas. Same story for TFPHashList.Pack btw.

It is correct. It is the address of the first pointer in the array of pointers.

Reply by email

Micha Nelissen
to Peter Vreman
Peter Vreman wrote 8 lines
> Micha Nelissen wrote: >> Hi, >> >> , is this correct ? Shouldn't it be FList^, since FList >> is a pointer to an array of pointers ? It is correct. It is the address of the first pointer in the array of pointers.

Conceptually, it is wrong. On the implementation level it may be correct.

FList = ^(array[0..Max] of Pointer);
FList[0] = (array[0..Max] of Pointer);
@FList[0] = ^(array[0..Max] of Pointer) = FList;
So address:
(@FList[0])[1] = (ptrint(FList) + 1 * sizeof(array[0..Max] of Pointer)));

Micha

Reply by email

Peter Vreman
to Micha Nelissen
you wrote 17 lines
Peter Vreman wrote: >>Micha Nelissen wrote: >>>Hi, >>> >>>, is this correct ? Shouldn't it be FList^, since FList >>>is a pointer to an array of pointers ? >It is correct. It is the address of the first pointer in the array of >pointers. Conceptually, it is wrong. On the implementation level it may be correct. FList = ^(array[0..Max] of Pointer); FList[0] = (array[0..Max] of Pointer); @FList[0] = ^(array[0..Max] of Pointer) = FList; So address: (@FList[0])[1] = (ptrint(FList) + 1 * sizeof(array[0..Max] of Pointer)));

It should be FList^[0]. Just like it is used the other methods of the TFPList class

Peter

Reply by email