[fpc-devel] Memory leak on BeginThread() when RTL compiled with -O2
NetSpirit
netspirit at meta.ua
Mon May 24 11:00:32 CEST 2021
Unfortunately I tried it and this doesn't work.
Problem only with 'sysinitpas.pp' unit.
He is not depends on other RTL units, but linked into final executable by
compiler.
I suppose, compiler itself depends on internal layout of this unit.
And a solution is to compile 'sysinitpas.pp' with the same options as
'ppc386.exe' was compiled, not RTL.
See my previuos demo: http://dl.free.fr/ePtkQwgJJ
> When compiling RTL you should disable reading of options from fpc.cfg
using the -n switch.
> When compiling the system unit use the -Us switch.
> Additionally specify only CPU/Target and optimization options -O. > No
other options are required for Windows RTL.
>
> When RTL is properly compiled, even with -O2, your test program works
without memory leaks.
>
> Yuriy Sydorov,
> jura at cp-lab.com
>
More information about the fpc-devel
mailing list