Hello.
How to do to retrieve the size of the array of pdynarraytypeinfo?
Thanks
Fre;D
-----
Many thanks ;-)

Mailing lists / fpc-pascal / 2020-03
8 messages · 2 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hello.
How to do to retrieve the size of the array of pdynarraytypeinfo?
Thanks
Fre;D
-----
Many thanks ;-)
Some more infos:
This gives the correct size with fpc <= 3.2.0:
function dynarrayelesize(const typinfo: pdynarraytypeinfo): sizeint;
var
ti: pdynarraytypeinfo;
begin
ti:= typinfo;
inc(pointer(ti),ord(pdynarraytypeinfo(ti)^.namelen)+2);
result:= psizeint(ti)^;
end;But with last trunk fpc 3.3.1 the result is always = 0.
Why?
-----
Many thanks ;-)
Same as the other alignment stuff. Best use PTypeInfo and PTypeData:
function DynArrayEleSize(const TypInfo: PTypeInfo): SizeInt;
begin
Result := GetTypeData(TypInfo)^.elSize;
end;Regards,
Sven
Hello Sven.
Always good news with you!
OK, I did replace all call to pdynarraytypeinfo with PTypeInfo and adapt all code for this.
And you know what: IT WORKS!
I am totally surprised but now msestat files are ok with fpc 3.3.1.
Well, well, well done Sven (you could not imagine how happy I am).
Now I will do extended test to check is all is really ok.
By the way, may I use this tip for fpc < 3.3.1 or is it ok only with fpc trunk?
Many thanks Sven.
Fre;D
-----
Many thanks ;-)
By the way, may I use this tip for fpc < 3.3.1 or is it ok only with fpc
trunk?
Ok, I did compile it with FPC 3.0.4, FPC 3.2.0 and FPC 3.3.1.
And...
...
Yes, all 3 works as expected.
;-) x 1000.
Time to commit it (but I wait for your green light Sven).
Fre;D
-----
Many thanks ;-)
Time to commit it (but I wait for your green light Sven).
I did commit the change because after many tests, I cannot find problems (but if you see a warning or a tip, it is welcome).
Many thanks Sven.
Fre;D
-----
Many thanks ;-)
Hello Sven. Always good news with you! OK, I did replace all call to pdynarraytypeinfo…
fredvs via fpc-pascal schrieb am Mo., 23.
März 2020, 22:27:
By the way, may I use this tip for fpc < 3.3.1 or is it ok only with fpc trunk?
Yes, it will also work with older be versions - as you noticed already. ;)
Regards,
Sven
Super.
And I am so happy that the best representative of what fpc can do is still in the game.
Thanks Sven.
Fre;D
-----
Many thanks ;-)