Sign in Join

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

Mailing lists / fpc-pascal / 2010-05

$CODEALIGN / Dynamic Arrays

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

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 of an allocator.

Any thoughts ?

thanks,
helmut

Jonas Maebe
to Helmut Hartl
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.

Show quoted text 5 lines
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 of an allocator.

It doesn't support that. The proper way to support it would be to add some kind of vector data type to the compiler, whose rtti would indicate the alignment requirements (so the dynamic array allocation would take care of the alignment automatically).

Jonas