@@ -232,7 +232,16 @@ function __init__()
232232 end
233233
234234 # Register gc tracked allocator if CHOLMOD is new enough
235- if current_version >= v " 3.0.0"
235+ if current_version >= v " 4.0.3"
236+ ccall ((:SuiteSparse_config_malloc_func_set , :libsuitesparseconfig ),
237+ Cvoid, (Ptr{Cvoid},), cglobal (:jl_malloc , Ptr{Cvoid}))
238+ ccall ((:SuiteSparse_config_calloc_func_set , :libsuitesparseconfig ),
239+ Cvoid, (Ptr{Cvoid},), cglobal (:jl_calloc , Ptr{Cvoid}))
240+ ccall ((:SuiteSparse_config_realloc_func_set , :libsuitesparseconfig ),
241+ Cvoid, (Ptr{Cvoid},), cglobal (:jl_realloc , Ptr{Cvoid}))
242+ ccall ((:SuiteSparse_config_free_func_set , :libsuitesparseconfig ),
243+ Cvoid, (Ptr{Cvoid},), cglobal (:jl_free , Ptr{Cvoid}))
244+ elseif current_version >= v " 3.0.0"
236245 cnfg = cglobal ((:SuiteSparse_config , :libsuitesparseconfig ), Ptr{Cvoid})
237246 unsafe_store! (cnfg, cglobal (:jl_malloc , Ptr{Cvoid}), 1 )
238247 unsafe_store! (cnfg, cglobal (:jl_calloc , Ptr{Cvoid}), 2 )
0 commit comments