Skip to content

Commit 9f98de7

Browse files
committed
Adding GC.gc_active_impl
1 parent 5b6a0de commit 9f98de7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

base/Base.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ include("sysinfo.jl")
128128
include("libc.jl")
129129
using .Libc: getpid, gethostname, time, memcpy, memset, memmove, memcmp
130130

131-
const USING_STOCK_GC = occursin("stock", unsafe_string(ccall(:jl_gc_active_impl, Ptr{UInt8}, ())))
131+
const USING_STOCK_GC = occursin("stock", GC.gc_active_impl())
132132

133133
# These used to be in build_h.jl and are retained for backwards compatibility.
134134
# NOTE: keep in sync with `libblastrampoline_jll.libblastrampoline`.

base/gcutils.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,4 +281,15 @@ function logging_enabled()
281281
ccall(:jl_is_gc_logging_enabled, Cint, ()) != 0
282282
end
283283

284+
"""
285+
GC.gc_active_impl()
286+
287+
Return a string stating which GC implementation is being used and possibly
288+
its version according to the list of supported GCs
289+
"""
290+
function gc_active_impl()
291+
unsafe_string(ccall(:jl_gc_active_impl, Ptr{UInt8}, ()))
292+
end
293+
294+
284295
end # module GC

0 commit comments

Comments
 (0)