File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -441,11 +441,18 @@ The string literal could also be used directly before the function
441441name, if desired `"libglib-2.0".g_uri_escape_string(...`
442442
443443It's possible to declare the ccall as `gc_safe` by using the `gc_safe = true` option:
444+
444445 @ccall gc_safe=true strlen(s::Cstring)::Csize_t
446+
445447This allows the garbage collector to run concurrently with the ccall, which can be useful whenever
446448the `ccall` may block outside of julia.
447- WARNING: This option should be used with caution, as it can lead to undefined behavior if the ccall
448- calls back into the julia runtime. (`@cfunction`/`@ccallables` are safe however)
449+
450+ !!! warning
451+ This option should be used with caution, as it can lead to undefined behavior if the ccall
452+ calls back into the julia runtime. (`@cfunction`/`@ccallables` are safe however)
453+
454+ !!! compat "Julia 1.12"
455+ The `gc_safe` argument requires Julia 1.12 or higher.
449456"""
450457macro ccall (exprs... )
451458 return ccall_macro_lower ((:ccall ), ccall_macro_parse (exprs)... )
You can’t perform that action at this time.
0 commit comments