You are not logged in.
Good day,
I was busy with the CrossPlatform version of SynLZ (SynCrossPlatformSynLZ.pas)
And I came across a bug for the Android64 platform.
The PtrUInt is of version cardinal (which is a 32bits unsigned int) is not suited to hold a 64 bits pointer
I adjusted the compress and decompress procedures to work with android 64bits platform.
Are you interested in the adjusted source code?
Last edited by jasglas (2020-12-07 18:55:08)
Offline
You are right.
It should be fixed by https://synopse.info/fossil/info/1d01ddf409
Online
Thank you!
Offline
Hi again,
I've updated the revised version from Git and compiled it again.
But the function SynLZdecomp in file CrossPlatform\SynCrossPlatformSynLZ.pas has a pointer bug if you compile it in Android64.
You can fix it by changing like below.
original code:
function SynLZdecomp(src: pointer; size: cardinal; dst: pointer): cardinal;
var last_hashed, // initial src and dst value
src_end: PtrUInt;
CW, CWbit: cardinal;
v, t, h, o: cardinal;
i: integer;
offset: array[0..4095] of PtrUInt; // 16KB hashing code
label nextCW;
begin
src_end := PtrUInt(src)+size;
.............
revised code:
function SynLZdecomp(src: pointer; size: cardinal; dst: pointer): cardinal;
var last_hashed, // initial src and dst value
src_end: PtrUInt;
CW, CWbit: cardinal;
v, t, h, o: PtrUInt;
i: integer;
offset: array[0..4095] of PtrUInt; // 16KB hashing code
label nextCW;
begin
src_end := PtrUInt(src)+size;
.............
Thank you.
Offline
You are right!
Please check https://synopse.info/fossil/info/e7da63acf8
Out of curiosity, what is the performance of this unit on Delphi Android?
Online
Hi,
Thanks for the update.
Regarding the performance. I come from the Indy ZLib usage in Android.
And I see no obvious slower speeds.
But to know is to measure and I have not a test in place to compare the speed yet.
Offline
It will compress less good than ZLib for sure, since it is a plain LZ algorithm, without Huffman encoding.
It should be faster - it is much faster than ZLib on Intel/AMD, especially the compression. But it will depend on the Delphi Android ARM compiler itself.
Online
I'm not a compression expert but I know the basics.
As soon as Delphi has a build in assembler for ARM processors it should be possible to have a very fast compression for android as well, like for Intel/AMD.
I do like the open source in Mormot compared to Indy. It gives me confidense to know what's going on with the data.
Keep up the good work!
Offline