Skip to content

Commit

Permalink
Be more optimistic about the world
Browse files Browse the repository at this point in the history
but still provide the hook for arrays to improve
  • Loading branch information
mbauman committed Apr 27, 2020
1 parent 7a3cdb1 commit 55e10b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -897,13 +897,13 @@ broadcast_unalias(::Nothing, src) = src
"""
potentially_self_aliased(A)
Conservatively returns true if multiple locations in `A` might reference the same memory
Returns true if multiple locations in `A` reference the same memory
"""
potentially_self_aliased(::DenseArray) = false
potentially_self_aliased(A::StridedArray) = any(==(0), strides(A))
potentially_self_aliased(A::SubArray) = any(!allunique, A.indices)
potentially_self_aliased(A::SubArray) = any(map(!allunique, A.indices))
potentially_self_aliased(A::Union{Base.ReshapedArray,Base.ReinterpretArray}) = potentially_self_aliased(A.parent)
potentially_self_aliased(::Any) = true
potentially_self_aliased(::Any) = false

# Preprocessing a `Broadcasted` does two things:
# * unaliases any arguments from `dest`
Expand Down

0 comments on commit 55e10b2

Please sign in to comment.