On Wed, Mar 29, 2023 at 11:07:18PM +0200, Jonas Maebe via fpc-pascal wrote:
> On 29/03/2023 16:00, Matias Ezequiel Vara Larsen via fpc-pascal wrote:
> > So if I have a type like:
> >
> > test = record
> >r: DWord;
> >s: Word;
> > end;
> >
> > Then, I define the variable `nada` as an array
On 3/29/2023 2:38 PM, Ched via fpc-pascal wrote:
Hello,
Ok for the records for internal calculations. But sometimes, records
are used for reading/writing structured files. Does "packed" in
"packed array" and "packed record" always forbid the compiler to play
with alignments ?
If that recor
Hello,
Ok for the records for internal calculations. But sometimes, records are used for reading/writing
structured files. Does "packed" in "packed array" and "packed record" always forbid the compiler to play
with alignments ?
Kindest regards, Ched'
Le 29.03.23 à 21:07, Jonas Maebe via f
On 29/03/2023 16:00, Matias Ezequiel Vara Larsen via fpc-pascal wrote:
So if I have a type like:
test = record
r: DWord;
s: Word;
end;
Then, I define the variable `nada` as an array of `test` type:
var
nada: array[0..2] of test;
Is the `@nada[1].r` element aligned to 4-bytes?
Recor
On Wed, Mar 29, 2023 at 08:11:40PM +0700, Hairy Pixels via fpc-pascal wrote:
>
>
> > On Mar 29, 2023, at 1:33 PM, Sven Barth via fpc-pascal
> > wrote:
> >
> > No, array types are defined as never having padding between the elements.
> > You need to make sure that the element is appropriately
On Wed, Mar 29, 2023 at 08:33:58AM +0200, Sven Barth via fpc-pascal wrote:
> Matias Ezequiel Vara Larsen via fpc-pascal
> schrieb am Mi., 29. März 2023, 00:27:
>
> > Hello,
> >
> > On Mon, Mar 27, 2023 at 09:35:38PM +0200, Jonas Maebe via fpc-pascal wrote:
> > > On 27/03/2023 21:25, denisgolovan
> On Mar 29, 2023, at 1:33 PM, Sven Barth via fpc-pascal
> wrote:
>
> No, array types are defined as never having padding between the elements. You
> need to make sure that the element is appropriately sized then.
>
Wouldn’t that be better for performance if each element was padded to alig
On Mon, Mar 27, 2023 at 08:52:40PM +0200, Jonas Maebe via fpc-pascal wrote:
> On 27/03/2023 09:28, Matias Ezequiel Vara Larsen via fpc-pascal wrote:
> > Apologies in the case this subject has been already discussed. I require
> > that some global variables be cache-line aligned. This is a requireme
On Wed, Mar 29, 2023 at 08:33:58AM +0200, Sven Barth via fpc-pascal wrote:
> Matias Ezequiel Vara Larsen via fpc-pascal
> schrieb am Mi., 29. März 2023, 00:27:
>
> > Hello,
> >
> > On Mon, Mar 27, 2023 at 09:35:38PM +0200, Jonas Maebe via fpc-pascal wrote:
> > > On 27/03/2023 21:25, denisgolovan
Matias Ezequiel Vara Larsen via fpc-pascal
schrieb am Mi., 29. März 2023, 00:27:
> Hello,
>
> On Mon, Mar 27, 2023 at 09:35:38PM +0200, Jonas Maebe via fpc-pascal wrote:
> > On 27/03/2023 21:25, denisgolovan via fpc-pascal wrote:
> >
> > > But it's still not possible to attach alignment to type i
Hello,
On Mon, Mar 27, 2023 at 09:35:38PM +0200, Jonas Maebe via fpc-pascal wrote:
> On 27/03/2023 21:25, denisgolovan via fpc-pascal wrote:
>
> > But it's still not possible to attach alignment to type itself instead of
> > variable, right?
>
> It is possible
> (https://gitlab.com/freepascal.
> It is possible
> (https://gitlab.com/freepascal.org/fpc/source/-/blob/main/tests/test/talignrec1.pp),
> but it is subject to the same limitations when declaring variables of
> those types.
>
> Jonas
Aha. Nice!
Does it work recursively? I mean - does it work when aligned record is itself a
f
On 27/03/2023 21:25, denisgolovan via fpc-pascal wrote:
But it's still not possible to attach alignment to type itself instead of
variable, right?
It is possible
(https://gitlab.com/freepascal.org/fpc/source/-/blob/main/tests/test/talignrec1.pp),
but it is subject to the same limitations wh
> However, the maximum alignment you can specify this way is limited per
> target (hardcoded in the compiler). In 3.2.x, it's 16 bytes for most
> desktop targets. On 3.3.x, it's 64 bytes for most desktop targets.
>
> Jonas
But it's still not possible to attach alignment to type itself instead
On 27/03/2023 09:28, Matias Ezequiel Vara Larsen via fpc-pascal wrote:
Apologies in the case this subject has been already discussed. I require
that some global variables be cache-line aligned. This is a requirement
for per-CPU variables that are statically defined to prevent cache
ping-pong. Is
Hello everyone,
Apologies in the case this subject has been already discussed. I require
that some global variables be cache-line aligned. This is a requirement
for per-CPU variables that are statically defined to prevent cache
ping-pong. Is there any way to do this at fpc when the record is
decl
16 matches
Mail list logo