Skip to content

Commit

Permalink
Use callsite annotation instead of outlined function
Browse files Browse the repository at this point in the history
Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
  • Loading branch information
Seelengrab and aviatesk committed Dec 7, 2023
1 parent 5be5ed2 commit 77bfb46
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions base/hashing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ hash(x::Any) = hash(x, zero(UInt))
hash(w::WeakRef, h::UInt) = hash(w.value, h)

# Types can't be deleted, so marking as total allows the compiler to look up the hash
@assume_effects :total _typehash(T::Type) = ccall(:jl_type_hash, UInt, (Any,), T)
hash(T::Type, h::UInt) = hash_uint(3h - _typehash(T))
hash(T::Type, h::UInt) = hash_uint(3h - @assume_effects :total ccall(:jl_type_hash, UInt, (Any,), T))

## hashing general objects ##

Expand Down

0 comments on commit 77bfb46

Please sign in to comment.