mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 14:49:33 +02:00

alignment for each memory reference (mantis #12137, and test/packages/fcl-registry/tregistry1.pp on sparc). This also enables better code generation for packed records in many cases. o several changes were made to the compiler to minimise the chances of accidentally forgetting to set the alignment of memory references in the future: - reference_reset*() now has an extra alignment parameter - location_reset() can now only be used for non LOC_(C)REFERENCE, use location_reset_ref() for those (split the tloc enum so the compiler can catch errors using range checking) git-svn-id: trunk@12719 -
26 lines
576 B
ObjectPascal
26 lines
576 B
ObjectPascal
{$t-}
|
|
type
|
|
TElementValidator = object
|
|
FElementDef: pointer;
|
|
FCurCP: pointer;
|
|
FFailed: Boolean;
|
|
end;
|
|
|
|
var
|
|
FValidator: array of TElementValidator;
|
|
i: longint;
|
|
begin
|
|
i:=1;
|
|
setlength(fvalidator,5);
|
|
writeln(ptruint(pointer(@fvalidator[1])-pointer(@fvalidator[0])));
|
|
{ aligned }
|
|
fvalidator[0].felementdef:=@FValidator;
|
|
fvalidator[0].fcurcp:=@FValidator;
|
|
{ unaligned }
|
|
fvalidator[1].felementdef:=@FValidator;
|
|
fvalidator[1].fcurcp:=@FValidator;
|
|
{ unaligned }
|
|
fvalidator[i].felementdef:=@FValidator;
|
|
fvalidator[i].fcurcp:=@FValidator;
|
|
end.
|