File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -94,4 +94,19 @@ macro preserve(args...)
94
94
end )
95
95
end
96
96
97
+ """
98
+ GC.safepoint()
99
+
100
+ Inserts a point in the program where garbage collection may run.
101
+ This can be useful in rare cases in multi-threaded programs where some threads
102
+ are allocating memory (and hence may need to run GC) but other threads are doing
103
+ only simple operations (no allocation, task switches, or I/O).
104
+ Calling this function periodically in non-allocating threads allows garbage
105
+ collection to run.
106
+
107
+ !!! compat "Julia 1.4"
108
+ This function is available as of Julia 1.4.
109
+ """
110
+ safepoint () = ccall (:jl_gc_safepoint , Cvoid, ())
111
+
97
112
end # module GC
Original file line number Diff line number Diff line change @@ -395,6 +395,7 @@ Base.functionloc(::Method)
395
395
Base.GC.gc
396
396
Base.GC.enable
397
397
Base.GC.@preserve
398
+ Base.GC.safepoint
398
399
Meta.lower
399
400
Meta.@lower
400
401
Meta.parse(::AbstractString, ::Int)
You can’t perform that action at this time.
0 commit comments