Re: [fpc-pascal] FPC bug or brain bug ?

2010-05-27 Thread Jonas Maebe
On 27 May 2010, at 23:31, Yann Bat wrote: >> The compiler always adds a VMT if an object has a constructor or destructor. >> The reason is that the VMT also contains the instance size, which is used by >> the constructor helper to allocate the required amount of memory. > > Ok but why a differ

Re: [fpc-pascal] FPC bug or brain bug ?

2010-05-27 Thread Yann Bat
> The compiler always adds a VMT if an object has a constructor or destructor. > The reason is that the VMT also contains the instance size, which is used by > the constructor helper to allocate the required amount of memory. > Ok but why a different behaviour between [fpc | objfpc] mode and [tp

Re: [fpc-pascal] FPC bug or brain bug ?

2010-05-27 Thread Jonas Maebe
On 27 May 2010, at 16:01, Yann Bat wrote: > I don't understand why compilation of the program below failed in fpc > and objfpc mode. In tp and delphi mode it works as expected but in fpc > and objfpc mode the compiler complains : > > blob.pas(17,3) Error: Constants of objects containing a VMT a

Re: [fpc-pascal] FPC bug or brain bug ?

2010-05-27 Thread Jonas Maebe
On 27 May 2010, at 21:51, Flávio Etrusco wrote: > On Thu, May 27, 2010 at 11:01 AM, Yann Bat wrote: >> type >> TBlob = object >>private >> fId : LongInt; >> >>public >> constructor Init; >> function Id: LongInt; >> end; >> >> PBlob=^TBlob; >> >> const >> NullBlob :

Re: [fpc-pascal] FPC bug or brain bug ?

2010-05-27 Thread Flávio Etrusco
All TObject descendants have a VMT. The destructor is virtual, BTW. -Flávio On Thu, May 27, 2010 at 11:01 AM, Yann Bat wrote: > Hi, > > I don't understand why compilation of the program below failed in fpc > and objfpc mode. In tp and delphi mode it works as expected but in fpc > and objfpc mode

[fpc-pascal] FPC bug or brain bug ?

2010-05-27 Thread Yann Bat
Hi, I don't understand why compilation of the program below failed in fpc and objfpc mode. In tp and delphi mode it works as expected but in fpc and objfpc mode the compiler complains : blob.pas(17,3) Error: Constants of objects containing a VMT aren't allowed blob.pas(17,3) Fatal: Syntax err

Re: [fpc-pascal] $CODEALIGN / Dynamic Arrays

2010-05-27 Thread Jonas Maebe
On 27 May 2010, at 09:47, Helmut Hartl wrote: Does the $CODEALIGN (http://www.freepascal.org/docs-html/prog/progsu9.html ) directive influence dynamic array memory layout ? No, that directive only influences static code and data layout. I need an an aligned dynamic array of vectors for SSE

[fpc-pascal] $CODEALIGN / Dynamic Arrays

2010-05-27 Thread Helmut Hartl
Does the $CODEALIGN (http://www.freepascal.org/docs-html/prog/progsu9.html) directive influence dynamic array memory layout ? I need an an aligned dynamic array of vectors for SSE operations. If the fpc dynamic array implementation supports alignment somehow I would not need an own implementation