fix #16752: threadvar now works with importcpp types; osx now uses native TLS (--tlsEmulation:off), which can be orders of magnitude faster (#16750)
* osx now uses native TLS, which can be orders of magnitude faster
* add {.cppNonPod.}
* improve test
* changelog, docs, disable part of windows test
This commit is contained in:
parent
3c8fddbc76
commit
e112974920
13 changed files with 194 additions and 13 deletions
|
|
@ -7214,6 +7214,19 @@ will generate this code:
|
|||
__interrupt void myinterrupt()
|
||||
|
||||
|
||||
`cppNonPod` pragma
|
||||
------------------
|
||||
|
||||
The `.cppNonPod` pragma should be used for non-POD `importcpp` types so that they
|
||||
work properly (in particular regarding constructor and destructor) for
|
||||
`.threadvar` variables. This requires `--tlsEmulation:off`.
|
||||
|
||||
.. code-block:: nim
|
||||
type Foo {.cppNonPod, importcpp, header: "funs.h".} = object
|
||||
x: cint
|
||||
proc main()=
|
||||
var a {.threadvar.}: Foo
|
||||
|
||||
InjectStmt pragma
|
||||
-----------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue