@@ -49,29 +49,20 @@ Module with garbage collection utilities.
4949"""
5050module GC
5151
52- # @enum-like structure
53- struct CollectionType
54- x:: Int
55- end
56- Base. cconvert (:: Type{Cint} , collection:: CollectionType ) = Cint (collection. x)
57-
58- const Auto = CollectionType (0 )
59- const Full = CollectionType (1 )
60- const Incremental = CollectionType (2 )
61-
6252"""
63- GC.gc(full::Bool=true )
64- GC.gc(collection::CollectionType )
53+ GC.gc()
54+ GC.gc(full::Bool )
6555
66- Perform garbage collection. The argument `full` determines whether a full, but more costly
67- collection is performed. Otherwise, heuristics are used to determine which type of
68- collection is needed. For exact control, pass an argument of type `CollectionType`.
56+ Perform garbage collection. The argument `full` determines the kind of collection: A full
57+ collection scans all objects, while an incremental collection only scans so-called young
58+ objects and is much quicker. If called without an argument, heuristics are used to determine
59+ which type of collection is needed.
6960
7061!!! warning
7162 Excessive use will likely lead to poor performance.
7263"""
73- gc (full :: Bool = true ) = ccall (:jl_gc_collect , Cvoid, (Cint,), full )
74- gc (collection :: CollectionType ) = ccall (:jl_gc_collect , Cvoid, (Cint,), collection )
64+ gc () = ccall (:jl_gc_collect , Cvoid, (Cint,), 0 )
65+ gc (full :: Bool ) = ccall (:jl_gc_collect , Cvoid, (Cint,), full ? 1 : 2 )
7566
7667"""
7768 GC.enable(on::Bool)
0 commit comments