You are not logged in.
Pages: 1
In code I found few pleces where insted
length(RawUTF8)
is used metod like in "UnCamelCase"
(Sometimes i used this metod too )
function UnCamelCase(const S: RawUTF8): RawUTF8; overload;
begin
result := '';
if S='' then
exit;
SetLength(result,PInteger(PtrInt(S)-sizeof(integer))^*2); // max length
...
...
This metod works OK in Delphi (64 and 32 bit) but not always in FPC and Lazarus ,
for example
in 64 bit windows version length is on -8 position
in 32 bit windows version length is on -4 position (identical like Delphi)
This problem is in fundamental functions:
Utf8DecodeToRawUnicode
Utf8DecodeToRawUnicodeUI
UrlDecode
UnCamelCase
Is chanse to fix it ?
For example
{$IFDEF FPC}
SetLength(result,PInteger(PtrInt(S)-sizeof(pointer))^*2);
{$ELSE}
SetLength(result,PInteger(PtrInt(S)-sizeof(integer))^*2);
{$ENDIF FPC}
Always exist this difference ? Where read about fpc string ?
I try find "StrRec" definiction in FPC but nothing about this
I read this
http://wiki.freepascal.org/Character_an … AnsiString
On picture is 4B for length and othing about 64 bit
I would like to run 64 bit ,
I will send more comments to this
It is ok ?
Last edited by marius maximus (2015-06-13 20:31:17)
Lazarus x64 Linux
Offline
Step by step and we(I) fix all
for example better version
{$IFDEF FPC}
SetLength(result,length(s)*2);
{$ELSE}
SetLength(result,PInteger(PtrInt(S)-sizeof(integer))^*2);
{$ENDIF FPC}
I look in asembler and fpc create better asm like Delphi
version with length(s) is near "(PtrInt(S)-sizeof(integer)"
Or other version is create for example "CONST _str_length_pos"
and use "(PtrInt(S)-_str_length_pos)"
and add few "ifdef" in Synopse.inc
After this fix , next sample project start works
A find this bug when try run "07 - SynTest"
I need to take a workshop next project
Last edited by marius maximus (2015-06-13 22:04:14)
Lazarus x64 Linux
Offline
Arnaud,
Zeos 7.2 cope well with fpc-64bit.
Michael were a little worked hard at it.
You can peek into its functions.
Specifically to ZFastCode.pas and other from directory "core".
Michal
Last edited by miab3 (2015-06-13 23:13:00)
Offline
I made a first pass for FPC 64bit compatibility.
See http://synopse.info/fossil/info/f1bc7c708f
There was A LOT of issues with the string length direct access.
But there is more to fix!
Online
Thx very much ,
I always use svn but try git ,
I improvise
I find two bugs (very small)
https://github.com/mariuszekpl/mORMot/c … a20282853c
Lazarus x64 Linux
Offline
Please check http://synopse.info/fossil/info/89aa81e89b
Thanks for the patch!
Online
a step in the right direction,
I will be tested
Lazarus x64 Linux
Offline
I was able compile "TestSql3" ("Synopse mORMot Framework Automated tests") in 64bit fpc.
a lot of red and a long way yet
Lazarus x64 Linux
Offline
Also take a look at http://synopse.info/fossil/info/681c49d8b9
Online
Pages: 1