mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-05 20:30:53 +02:00
* use sizeint, instead of pint/ptrsinttype for emitting the reference count and
length of string constants git-svn-id: trunk@34621 -
This commit is contained in:
parent
710c830859
commit
b3deb8a152
@ -1077,8 +1077,11 @@ implementation
|
|||||||
|
|
||||||
|
|
||||||
class function ttai_typedconstbuilder.get_string_header_size(typ: tstringtype; winlikewidestring: boolean): pint;
|
class function ttai_typedconstbuilder.get_string_header_size(typ: tstringtype; winlikewidestring: boolean): pint;
|
||||||
const
|
var
|
||||||
ansistring_header_size =
|
ansistring_header_size: pint;
|
||||||
|
unicodestring_header_size: pint;
|
||||||
|
begin
|
||||||
|
ansistring_header_size:=
|
||||||
{ encoding }
|
{ encoding }
|
||||||
2 +
|
2 +
|
||||||
{ elesize }
|
{ elesize }
|
||||||
@ -1088,11 +1091,10 @@ implementation
|
|||||||
4 +
|
4 +
|
||||||
{$endif cpu64bitaddr}
|
{$endif cpu64bitaddr}
|
||||||
{ reference count }
|
{ reference count }
|
||||||
sizeof(pint) +
|
sizesinttype.size +
|
||||||
{ length }
|
{ length }
|
||||||
sizeof(pint);
|
sizesinttype.size;
|
||||||
unicodestring_header_size = ansistring_header_size;
|
unicodestring_header_size:=ansistring_header_size;
|
||||||
begin
|
|
||||||
case typ of
|
case typ of
|
||||||
st_ansistring:
|
st_ansistring:
|
||||||
result:=ansistring_header_size;
|
result:=ansistring_header_size;
|
||||||
@ -1322,10 +1324,10 @@ implementation
|
|||||||
emit_tai(tai_const.create_32bit(0),u32inttype);
|
emit_tai(tai_const.create_32bit(0),u32inttype);
|
||||||
inc(result.ofs,4);
|
inc(result.ofs,4);
|
||||||
{$endif cpu64bitaddr}
|
{$endif cpu64bitaddr}
|
||||||
emit_tai(tai_const.create_pint(-1),ptrsinttype);
|
emit_tai(tai_const.create_sizeint(-1),sizesinttype);
|
||||||
inc(result.ofs,sizeof(pint));
|
inc(result.ofs,sizesinttype.size);
|
||||||
emit_tai(tai_const.create_pint(len),ptrsinttype);
|
emit_tai(tai_const.create_sizeint(len),sizesinttype);
|
||||||
inc(result.ofs,sizeof(pint));
|
inc(result.ofs,sizesinttype.size);
|
||||||
if string_symofs=0 then
|
if string_symofs=0 then
|
||||||
begin
|
begin
|
||||||
{ results in slightly more efficient code }
|
{ results in slightly more efficient code }
|
||||||
|
Loading…
Reference in New Issue
Block a user