Skip to content

Commit

Permalink
Fix _length in reinterpretarray (#28068)
Browse files Browse the repository at this point in the history
#27941 and #24899 were merged "together" but should have gotten their
stories consistent first.
  • Loading branch information
timholy authored and mbauman committed Jul 12, 2018
1 parent 8d7c145 commit 8ab41d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/reinterpretarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct ReinterpretArray{T,N,S,A<:AbstractArray{S, N}} <: AbstractArray{T, N}
(N != 0 || sizeof(T) == sizeof(S)) || throwsize0(S, T)
ax1 = axes(a)[1]
if N != 0 && sizeof(S) != sizeof(T)
dim = _length(ax1)
dim = length(ax1)
rem(dim*sizeof(S),sizeof(T)) == 0 || thrownonint(S, T, dim)
first(ax1) == 1 || throwaxes1(S, T, ax1)
end
Expand Down Expand Up @@ -77,7 +77,7 @@ end

function axes(a::ReinterpretArray{T,N,S} where {N}) where {T,S}
paxs = axes(a.parent)
f, l = first(paxs[1]), _length(paxs[1])
f, l = first(paxs[1]), length(paxs[1])
size1 = div(l*sizeof(S), sizeof(T))
tuple(oftype(paxs[1], f:f+size1-1), tail(paxs)...)
end
Expand Down

2 comments on commit 8ab41d6

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.