Skip to content

Commit

Permalink
Remove unused jl_get_ptls_states_wrapper, update comments (JuliaLang#…
Browse files Browse the repository at this point in the history
…39066)

Since jl_get_ptls_states_wrapper is static, it can't be called by outside code.
  • Loading branch information
fingolfin authored Jan 13, 2021
1 parent 492096f commit 7a1a325
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@ jl_get_ptls_states_func jl_get_ptls_states_getter(void)
// We use the faster static version in the main executable to replace
// the slower version in the shared object. The code in different libraries
// or executables, however, have to agree on which version to use.
// The general solution is to add one more indirection in the C entry point
// (see `jl_get_ptls_states_wrapper`).
// The general solution is to add one more indirection in the C entry point.
//
// When `ifunc` is available, we can use it to trick the linker to use the
// real address (`jl_get_ptls_states_static`) directly as the symbol address.
// (see `jl_get_ptls_states_resolve`).
//
// However, since the detection of the static version in `ifunc`
// is not guaranteed to be reliable, we still need to fallback to the wrapper
Expand Down Expand Up @@ -184,13 +182,6 @@ static jl_ptls_t jl_get_ptls_states_init(void)
return cb();
}

static JL_CONST_FUNC jl_ptls_t jl_get_ptls_states_wrapper(void) JL_GLOBALLY_ROOTED JL_NOTSAFEPOINT
{
#ifndef __clang_analyzer__
return (*jl_tls_states_cb)();
#endif
}

JL_DLLEXPORT void jl_set_ptls_states_getter(jl_get_ptls_states_func f)
{
if (f == jl_tls_states_cb || !f)
Expand Down

0 comments on commit 7a1a325

Please sign in to comment.