On 17.03.2017 17:13, Karoly Balogh (Charlie/SGR) wrote:
This is actually entirely platform specific. The underlying implementation of threadvars is very different for each platform, and highly depends both on the CPU arch and the OS.
That might be true.
Last time I checked (several years ago), the fpc implementations did OS calls when accessing thread vars with X86 architecture for Windows. This is not necessary. All C compilers I checked don't do this, but use a dedicated segment register, even though this (at that time) was not documented by Microsoft. Linux C compilers use a dedicated Segment register, as well, here its a regular documented feature of the OS. (I don't remember what fpc did for Linux at that time.)
Hopefully 64 bit platforms are better (and decently documented) on that behalf.
No idea about ARM etc. -Michael _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal