Recent

Author Topic: FPC 3.2.2 - Align for AnsiString  (Read 522 times)

paule32

  • Hero Member
  • *****
  • Posts: 647
  • One in all. But, not all in one.
FPC 3.2.2 - Align for AnsiString
« on: May 18, 2025, 01:53:29 pm »
is it possible to align the refernce counter of AnsiStrings ?
I realized some big gaps that are results of QWORD in the Assembly.

is there a switch or option to inject smaller ?

For my problem question I have add a Image of the binary of a test Application.
Take a look to the Arrows and the black box around.

Thanks for feedback.
MS-IIS - Internet Information Server, Apache, PHP/HTML/CSS, MinGW-32/64 MSys2 GNU C/C++ 13 (-stdc++20), FPC 3.2.2
A Friend in need, is a Friend indeed.

Thaddy

  • Hero Member
  • *****
  • Posts: 19272
  • Glad to be alive.
Re: FPC 3.2.2 - Align for AnsiString
« Reply #1 on: May 18, 2025, 03:30:41 pm »
I see a lot of words that usually apply to your code......

Anyway, jokes aside, try to find out all the alignment options that the compiler has....
When in need I will give you an answer....
objects are fine constructs. You can even initialize them with constructors.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12905
  • FPC developer.
Re: FPC 3.2.2 - Align for AnsiString
« Reply #2 on: May 18, 2025, 03:36:05 pm »
Strange. FPC 3.2. seems to declare ANSIREC as 32-bit, only FPC 3.3.1 pads them to 64-bit:
Code: Pascal  [Select][+][-]
  1. Type
  2.   PAnsiRec = ^TAnsiRec;
  3.   TAnsiRec = Record
  4.     CodePage    : TSystemCodePage;
  5.     ElementSize : Word;
  6. {$if not defined(VER3_2)}
  7.   {$ifdef CPU64}       
  8.     Ref         : Longint;
  9.   {$else}
  10.     Ref         : SizeInt;
  11.   {$endif}
  12. {$else}
  13.   {$ifdef CPU64}       
  14.     { align fields  }
  15.         Dummy       : DWord;
  16.   {$endif CPU64}
  17.     Ref         : SizeInt;
  18. {$endif}
  19.     Len         : SizeInt;
  20.   end;
  21.  
  22.  

 

TinyPortal © 2005-2018