Sign in Join

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

Mailing lists / fpc-devel / 2003-11

FreePascal and AnsiStrings

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

David Butler

Hi FPC developers

I see FreePascal uses the following internal format for AnsiStrings:

Ptr - 8 : Length
Ptr - 4 : Reference Count
Ptr : Characters

Delphi uses the following format:

Ptr - 8 : Reference Count
Ptr - 4 : Length
Ptr : Characters

My questions are:

1. Is the order purely incidental or is there a reason why FreePascal chose to use a different order than Delphi?

2. I know it is officially discouraged to use 'internal formats', but for optimization's sake, would it be safe to assume that the internal format for FreePascal's AnsiStrings will not change in the near future?

Regards

Reply by email

Peter Vreman
to David Butler
1. Is the order purely incidental or is there a reason why FreePascal chose to use a different order than Delphi?

incidental

2. I know it is officially discouraged to use 'internal formats', but for optimization's sake, would it be safe to assume that the internal format for FreePascal's AnsiStrings will not change in the near future?

We can't promise anything on internal formats. That is also why they are called "internal".

Also don't forget that ansistrings are not made for performance, but for the ease of use. So optimization is IMHO not a good example to use the internal format.

Reply by email

Marco van de Voort
to Peter Vreman

[ Charset ISO-8859-1 unsupported, converting... ]

Show quoted text 16 lines
> 1. Is the order purely incidental or is there a reason why FreePascal > chose to use a different order than Delphi? incidental > 2. I know it is officially discouraged to use 'internal formats', but > for optimization's sake, would it be safe to assume that the internal > format for FreePascal's AnsiStrings will not change in the near > future? We can't promise anything on internal formats. That is also why they are called "internal". Also don't forget that ansistrings are not made for performance, but for the ease of use. So optimization is IMHO not a good example to use the internal format.

Moreover accessing via tansirec is portable in this case?

Reply by email