Skip to content

Commit

Permalink
[Libdl] Use RTLD_NOLOAD when calling dlpath(::String) (JuliaLang#39676)
Browse files Browse the repository at this point in the history
This should make it faster and have fewer side-effects to look up the absolute path of libraries.
  • Loading branch information
staticfloat authored and johanmon committed Jul 5, 2021
1 parent 60458f0 commit c7ca39d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions base/libdl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,9 @@ julia> dlpath("libjulia")
```
"""
function dlpath(libname::Union{AbstractString, Symbol})
handle = dlopen(libname)
path = dlpath(handle)
dlclose(handle)
return path
dlopen(libname, RTLD_NOLOAD) do handle
return dlpath(handle)
end
end

if Sys.isapple()
Expand Down

0 comments on commit c7ca39d

Please sign in to comment.