Skip to content

Commit a5d6b50

Browse files
authored
Cleanup MemoryRef tests (#54681)
aka revert revert #54647. Sorry @Keno for merging with broken tests. Between unrelated failures on windows CI upload and the fact that the errors were all truncated, I missed it.
1 parent 62c9871 commit a5d6b50

File tree

18 files changed

+89
-91
lines changed

18 files changed

+89
-91
lines changed

base/array.jl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ isbitsunion(u::Type) = u isa Union && allocatedinline(u)
216216
function _unsetindex!(A::Array, i::Int)
217217
@inline
218218
@boundscheck checkbounds(A, i)
219-
@inbounds _unsetindex!(GenericMemoryRef(A.ref, i))
219+
@inbounds _unsetindex!(memoryref(A.ref, i))
220220
return A
221221
end
222222

@@ -239,14 +239,14 @@ function isassigned(a::Array, i::Int...)
239239
@_noub_if_noinbounds_meta
240240
@boundscheck checkbounds(Bool, a, i...) || return false
241241
ii = _sub2ind(size(a), i...)
242-
return @inbounds isassigned(memoryref(a.ref, ii, false))
242+
return @inbounds isassigned(memoryrefnew(a.ref, ii, false))
243243
end
244244

245245
function isassigned(a::Vector, i::Int) # slight compiler simplification for the most common case
246246
@inline
247247
@_noub_if_noinbounds_meta
248248
@boundscheck checkbounds(Bool, a, i) || return false
249-
return @inbounds isassigned(memoryref(a.ref, i, false))
249+
return @inbounds isassigned(memoryrefnew(a.ref, i, false))
250250
end
251251

252252

@@ -281,7 +281,7 @@ the same manner as C.
281281
"""
282282
function unsafe_copyto!(dest::Array, doffs, src::Array, soffs, n)
283283
n == 0 && return dest
284-
unsafe_copyto!(GenericMemoryRef(dest.ref, doffs), GenericMemoryRef(src.ref, soffs), n)
284+
unsafe_copyto!(memoryref(dest.ref, doffs), memoryref(src.ref, soffs), n)
285285
return dest
286286
end
287287

@@ -303,8 +303,8 @@ function _copyto_impl!(dest::Union{Array,Memory}, doffs::Integer, src::Union{Arr
303303
n > 0 || _throw_argerror("Number of elements to copy must be non-negative.")
304304
@boundscheck checkbounds(dest, doffs:doffs+n-1)
305305
@boundscheck checkbounds(src, soffs:soffs+n-1)
306-
@inbounds let dest = GenericMemoryRef(dest isa Array ? getfield(dest, :ref) : dest, doffs),
307-
src = GenericMemoryRef(src isa Array ? getfield(src, :ref) : src, soffs)
306+
@inbounds let dest = memoryref(dest isa Array ? getfield(dest, :ref) : dest, doffs),
307+
src = memoryref(src isa Array ? getfield(src, :ref) : src, soffs)
308308
unsafe_copyto!(dest, src, n)
309309
end
310310
return dest
@@ -348,7 +348,7 @@ copy
348348
@_nothrow_meta
349349
ref = a.ref
350350
newmem = ccall(:jl_genericmemory_copy_slice, Ref{Memory{T}}, (Any, Ptr{Cvoid}, Int), ref.mem, ref.ptr_or_offset, length(a))
351-
return $(Expr(:new, :(typeof(a)), :(Core.memoryref(newmem)), :(a.size)))
351+
return $(Expr(:new, :(typeof(a)), :(memoryref(newmem)), :(a.size)))
352352
end
353353

354354
## Constructors ##
@@ -964,21 +964,21 @@ function setindex! end
964964
function setindex!(A::Array{T}, x, i::Int) where {T}
965965
@_noub_if_noinbounds_meta
966966
@boundscheck (i - 1)%UInt < length(A)%UInt || throw_boundserror(A, (i,))
967-
memoryrefset!(memoryref(A.ref, i, false), x isa T ? x : convert(T,x)::T, :not_atomic, false)
967+
memoryrefset!(memoryrefnew(A.ref, i, false), x isa T ? x : convert(T,x)::T, :not_atomic, false)
968968
return A
969969
end
970970
function setindex!(A::Array{T}, x, i1::Int, i2::Int, I::Int...) where {T}
971971
@inline
972972
@_noub_if_noinbounds_meta
973973
@boundscheck checkbounds(A, i1, i2, I...) # generally _to_linear_index requires bounds checking
974-
memoryrefset!(memoryref(A.ref, _to_linear_index(A, i1, i2, I...), false), x isa T ? x : convert(T,x)::T, :not_atomic, false)
974+
memoryrefset!(memoryrefnew(A.ref, _to_linear_index(A, i1, i2, I...), false), x isa T ? x : convert(T,x)::T, :not_atomic, false)
975975
return A
976976
end
977977

978978
__safe_setindex!(A::Vector{Any}, @nospecialize(x), i::Int) = (@inline; @_nothrow_noub_meta;
979-
memoryrefset!(memoryref(A.ref, i, false), x, :not_atomic, false); return A)
979+
memoryrefset!(memoryrefnew(A.ref, i, false), x, :not_atomic, false); return A)
980980
__safe_setindex!(A::Vector{T}, x::T, i::Int) where {T} = (@inline; @_nothrow_noub_meta;
981-
memoryrefset!(memoryref(A.ref, i, false), x, :not_atomic, false); return A)
981+
memoryrefset!(memoryrefnew(A.ref, i, false), x, :not_atomic, false); return A)
982982
__safe_setindex!(A::Vector{T}, x, i::Int) where {T} = (@inline;
983983
__safe_setindex!(A, convert(T, x)::T, i))
984984

@@ -1050,7 +1050,7 @@ function _growbeg!(a::Vector, delta::Integer)
10501050
setfield!(a, :size, (newlen,))
10511051
# if offset is far enough advanced to fit data in existing memory without copying
10521052
if delta <= offset - 1
1053-
setfield!(a, :ref, @inbounds GenericMemoryRef(ref, 1 - delta))
1053+
setfield!(a, :ref, @inbounds memoryref(ref, 1 - delta))
10541054
else
10551055
@noinline (function()
10561056
memlen = length(mem)
@@ -1075,7 +1075,7 @@ function _growbeg!(a::Vector, delta::Integer)
10751075
if ref !== a.ref
10761076
@noinline throw(ConcurrencyViolationError("Vector can not be resized concurrently"))
10771077
end
1078-
setfield!(a, :ref, @inbounds GenericMemoryRef(newmem, newoffset))
1078+
setfield!(a, :ref, @inbounds memoryref(newmem, newoffset))
10791079
end)()
10801080
end
10811081
return
@@ -1114,7 +1114,7 @@ function _growend!(a::Vector, delta::Integer)
11141114
newmem = array_new_memory(mem, newmemlen2)
11151115
newoffset = offset
11161116
end
1117-
newref = @inbounds GenericMemoryRef(newmem, newoffset)
1117+
newref = @inbounds memoryref(newmem, newoffset)
11181118
unsafe_copyto!(newref, ref, len)
11191119
if ref !== a.ref
11201120
@noinline throw(ConcurrencyViolationError("Vector can not be resized concurrently"))
@@ -1146,7 +1146,7 @@ function _growat!(a::Vector, i::Integer, delta::Integer)
11461146
prefer_start = i <= div(len, 2)
11471147
# if offset is far enough advanced to fit data in beginning of the memory
11481148
if prefer_start && delta <= offset - 1
1149-
newref = @inbounds GenericMemoryRef(mem, offset - delta)
1149+
newref = @inbounds memoryref(mem, offset - delta)
11501150
unsafe_copyto!(newref, ref, i)
11511151
setfield!(a, :ref, newref)
11521152
for j in i:i+delta-1
@@ -1163,7 +1163,7 @@ function _growat!(a::Vector, i::Integer, delta::Integer)
11631163
newmemlen = max(overallocation(memlen), len+2*delta+1)
11641164
newoffset = (newmemlen - newlen) ÷ 2 + 1
11651165
newmem = array_new_memory(mem, newmemlen)
1166-
newref = @inbounds GenericMemoryRef(newmem, newoffset)
1166+
newref = @inbounds memoryref(newmem, newoffset)
11671167
unsafe_copyto!(newref, ref, i-1)
11681168
unsafe_copyto!(newmem, newoffset + delta + i - 1, mem, offset + i - 1, len - i + 1)
11691169
setfield!(a, :ref, newref)
@@ -1180,7 +1180,7 @@ function _deletebeg!(a::Vector, delta::Integer)
11801180
end
11811181
newlen = len - delta
11821182
if newlen != 0 # if newlen==0 we could accidentally index past the memory
1183-
newref = @inbounds GenericMemoryRef(a.ref, delta + 1)
1183+
newref = @inbounds memoryref(a.ref, delta + 1)
11841184
setfield!(a, :ref, newref)
11851185
end
11861186
setfield!(a, :size, (newlen,))
@@ -1497,16 +1497,16 @@ function sizehint!(a::Vector, sz::Integer; first::Bool=false, shrink::Bool=true)
14971497
end
14981498
newmem = array_new_memory(mem, sz)
14991499
if first
1500-
newref = GenericMemoryRef(newmem, inc + 1)
1500+
newref = memoryref(newmem, inc + 1)
15011501
else
1502-
newref = GenericMemoryRef(newmem)
1502+
newref = memoryref(newmem)
15031503
end
15041504
unsafe_copyto!(newref, ref, len)
15051505
setfield!(a, :ref, newref)
15061506
elseif first
15071507
_growbeg!(a, inc)
15081508
newref = getfield(a, :ref)
1509-
newref = GenericMemoryRef(newref, inc + 1)
1509+
newref = memoryref(newref, inc + 1)
15101510
setfield!(a, :size, (len,)) # undo the size change from _growbeg!
15111511
setfield!(a, :ref, newref) # undo the offset change from _growbeg!
15121512
else # last

base/boot.jl

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -534,15 +534,12 @@ const undef = UndefInitializer()
534534
# empty vector constructor
535535
(self::Type{GenericMemory{kind,T,addrspace}})() where {T,kind,addrspace} = self(undef, 0)
536536

537+
memoryref(mem::GenericMemory) = memoryrefnew(mem)
538+
memoryref(mem::GenericMemory, i::Integer) = memoryrefnew(memoryrefnew(mem), Int(i), @_boundscheck)
539+
memoryref(ref::GenericMemoryRef, i::Integer) = memoryrefnew(ref, Int(i), @_boundscheck)
537540
GenericMemoryRef(mem::GenericMemory) = memoryref(mem)
538-
GenericMemoryRef(ref::GenericMemoryRef, i::Integer) = memoryref(ref, Int(i), @_boundscheck)
539-
GenericMemoryRef(mem::GenericMemory, i::Integer) = memoryref(memoryref(mem), Int(i), @_boundscheck)
540-
GenericMemoryRef{kind,<:Any,AS}(mem::GenericMemory{kind,<:Any,AS}) where {kind,AS} = memoryref(mem)
541-
GenericMemoryRef{kind,<:Any,AS}(ref::GenericMemoryRef{kind,<:Any,AS}, i::Integer) where {kind,AS} = memoryref(ref, Int(i), @_boundscheck)
542-
GenericMemoryRef{kind,<:Any,AS}(mem::GenericMemory{kind,<:Any,AS}, i::Integer) where {kind,AS} = memoryref(memoryref(mem), Int(i), @_boundscheck)
543-
GenericMemoryRef{kind,T,AS}(mem::GenericMemory{kind,T,AS}) where {kind,T,AS} = memoryref(mem)
544-
GenericMemoryRef{kind,T,AS}(ref::GenericMemoryRef{kind,T,AS}, i::Integer) where {kind,T,AS} = memoryref(ref, Int(i), @_boundscheck)
545-
GenericMemoryRef{kind,T,AS}(mem::GenericMemory{kind,T,AS}, i::Integer) where {kind,T,AS} = memoryref(memoryref(mem), Int(i), @_boundscheck)
541+
GenericMemoryRef(mem::GenericMemory, i::Integer) = memoryref(mem, i)
542+
GenericMemoryRef(mem::GenericMemoryRef, i::Integer) = memoryref(mem, i)
546543

547544
const Memory{T} = GenericMemory{:not_atomic, T, CPU}
548545
const MemoryRef{T} = GenericMemoryRef{:not_atomic, T, CPU}
@@ -650,12 +647,12 @@ module IR
650647
export CodeInfo, MethodInstance, CodeInstance, GotoNode, GotoIfNot, ReturnNode,
651648
NewvarNode, SSAValue, SlotNumber, Argument,
652649
PiNode, PhiNode, PhiCNode, UpsilonNode, DebugInfo,
653-
Const, PartialStruct, InterConditional, EnterNode
650+
Const, PartialStruct, InterConditional, EnterNode, memoryref
654651

655652
using Core: CodeInfo, MethodInstance, CodeInstance, GotoNode, GotoIfNot, ReturnNode,
656653
NewvarNode, SSAValue, SlotNumber, Argument,
657654
PiNode, PhiNode, PhiCNode, UpsilonNode, DebugInfo,
658-
Const, PartialStruct, InterConditional, EnterNode
655+
Const, PartialStruct, InterConditional, EnterNode, memoryref
659656

660657
end # module IR
661658

base/compiler/optimize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ function iscall_with_boundscheck(@nospecialize(stmt), sv::PostOptAnalysisState)
666666
f === nothing && return false
667667
if f === getfield
668668
nargs = 4
669-
elseif f === memoryref || f === memoryrefget || f === memoryref_isassigned
669+
elseif f === memoryrefnew || f === memoryrefget || f === memoryref_isassigned
670670
nargs = 4
671671
elseif f === memoryrefset!
672672
nargs = 5

base/compiler/tfuncs.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,7 @@ end
20282028
hasintersect(widenconst(idx), Int) || return Bottom
20292029
return ref
20302030
end
2031-
add_tfunc(memoryref, 1, 3, memoryref_tfunc, 1)
2031+
add_tfunc(memoryrefnew, 1, 3, memoryref_tfunc, 1)
20322032

20332033
@nospecs function memoryrefoffset_tfunc(𝕃::AbstractLattice, mem)
20342034
hasintersect(widenconst(mem), GenericMemoryRef) || return Bottom
@@ -2181,7 +2181,7 @@ function _builtin_nothrow(𝕃::AbstractLattice, @nospecialize(f::Builtin), argt
21812181
@nospecialize(rt))
21822182
= partialorder(𝕃)
21832183
na = length(argtypes)
2184-
if f === memoryref
2184+
if f === memoryrefnew
21852185
return memoryref_builtin_common_nothrow(argtypes)
21862186
elseif f === memoryrefoffset
21872187
length(argtypes) == 1 || return false
@@ -2297,7 +2297,7 @@ const _EFFECT_FREE_BUILTINS = [
22972297
isa,
22982298
UnionAll,
22992299
getfield,
2300-
memoryref,
2300+
memoryrefnew,
23012301
memoryrefoffset,
23022302
memoryrefget,
23032303
memoryref_isassigned,
@@ -2332,7 +2332,7 @@ const _INACCESSIBLEMEM_BUILTINS = Any[
23322332
]
23332333

23342334
const _ARGMEM_BUILTINS = Any[
2335-
memoryref,
2335+
memoryrefnew,
23362336
memoryrefoffset,
23372337
memoryrefget,
23382338
memoryref_isassigned,
@@ -2503,7 +2503,7 @@ function builtin_effects(𝕃::AbstractLattice, @nospecialize(f::Builtin), argty
25032503
else
25042504
if contains_is(_CONSISTENT_BUILTINS, f)
25052505
consistent = ALWAYS_TRUE
2506-
elseif f === memoryref || f === memoryrefoffset
2506+
elseif f === memoryrefnew || f === memoryrefoffset
25072507
consistent = ALWAYS_TRUE
25082508
elseif f === memoryrefget || f === memoryrefset! || f === memoryref_isassigned
25092509
consistent = CONSISTENT_IF_INACCESSIBLEMEMONLY
@@ -2527,7 +2527,7 @@ function builtin_effects(𝕃::AbstractLattice, @nospecialize(f::Builtin), argty
25272527
else
25282528
inaccessiblememonly = ALWAYS_FALSE
25292529
end
2530-
if f === memoryref || f === memoryrefget || f === memoryrefset! || f === memoryref_isassigned
2530+
if f === memoryrefnew || f === memoryrefget || f === memoryrefset! || f === memoryref_isassigned
25312531
noub = memoryop_noub(f, argtypes) ? ALWAYS_TRUE : ALWAYS_FALSE
25322532
else
25332533
noub = ALWAYS_TRUE
@@ -2541,7 +2541,7 @@ function memoryop_noub(@nospecialize(f), argtypes::Vector{Any})
25412541
nargs == 0 && return true # must throw and noub
25422542
lastargtype = argtypes[end]
25432543
isva = isvarargtype(lastargtype)
2544-
if f === memoryref
2544+
if f === memoryrefnew
25452545
if nargs == 1 && !isva
25462546
return true
25472547
elseif nargs == 2 && !isva

base/deepcopy.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ function _deepcopy_memory_t(@nospecialize(x::Memory), T, stackdict::IdDict)
105105
end
106106
dest = typeof(x)(undef, length(x))
107107
stackdict[x] = dest
108-
xr = Core.memoryref(x)
109-
dr = Core.memoryref(dest)
108+
xr = memoryref(x)
109+
dr = memoryref(dest)
110110
for i = 1:length(x)
111-
xi = Core.memoryref(xr, i, false)
111+
xi = Core.memoryrefnew(xr, i, false)
112112
if Core.memoryref_isassigned(xi, :not_atomic, false)
113113
xi = Core.memoryrefget(xi, :not_atomic, false)
114114
if !isbits(xi)
115115
xi = deepcopy_internal(xi, stackdict)::typeof(xi)
116116
end
117-
di = Core.memoryref(dr, i, false)
117+
di = Core.memoryrefnew(dr, i, false)
118118
Core.memoryrefset!(di, xi, :not_atomic, false)
119119
end
120120
end
@@ -131,9 +131,9 @@ function deepcopy_internal(x::GenericMemoryRef, stackdict::IdDict)
131131
return stackdict[x]::typeof(x)
132132
end
133133
mem = getfield(x, :mem)
134-
dest = GenericMemoryRef(deepcopy_internal(mem, stackdict)::typeof(mem))
134+
dest = memoryref(deepcopy_internal(mem, stackdict)::typeof(mem))
135135
i = memoryrefoffset(x)
136-
i == 1 || (dest = Core.memoryref(dest, i, true))
136+
i == 1 || (dest = Core.memoryrefnew(dest, i, true))
137137
return dest
138138
end
139139

base/docs/basedocs.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2683,23 +2683,23 @@ julia> Memory{Float64}(undef, 3)
26832683
Memory{T}(::UndefInitializer, n)
26842684

26852685
"""
2686-
MemoryRef(memory)
2686+
`memoryref(::GenericMemory)`
26872687
2688-
Construct a MemoryRef from a memory object. This does not fail, but the
2689-
resulting memory may point out-of-bounds if the memory is empty.
2688+
Construct a `GenericMemoryRef` from a memory object. This does not fail, but the
2689+
resulting memory will point out-of-bounds if and only if the memory is empty.
26902690
"""
2691-
MemoryRef(::Memory)
2691+
memoryref(::Memory)
26922692

26932693
"""
2694-
MemoryRef(::Memory, index::Integer)
2695-
MemoryRef(::MemoryRef, index::Integer)
2694+
memoryref(::GenericMemory, index::Integer)
2695+
memoryref(::GenericMemoryRef, index::Integer)
26962696
2697-
Construct a MemoryRef from a memory object and an offset index (1-based) which
2697+
Construct a `GenericMemoryRef` from a memory object and an offset index (1-based) which
26982698
can also be negative. This always returns an inbounds object, and will throw an
26992699
error if that is not possible (because the index would result in a shift
27002700
out-of-bounds of the underlying memory).
27012701
"""
2702-
MemoryRef(::Union{Memory,MemoryRef}, ::Integer)
2702+
memoryref(::Union{GenericMemory,GenericMemoryRef}, ::Integer)
27032703

27042704
"""
27052705
Vector{T}(undef, n)

base/docs/intrinsicsdocs.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ The `Core.Intrinsics` module holds the `Core.IntrinsicFunction` objects.
2323
Core.Intrinsics
2424

2525
"""
26-
Core.memoryref(::GenericMemory)
27-
Core.memoryref(::GenericMemoryRef, index::Int, [boundscheck::Bool])
26+
Core.memoryrefnew(::GenericMemory)
27+
Core.memoryrefnew(::GenericMemoryRef, index::Int, [boundscheck::Bool])
2828
29-
Return a `GenericMemoryRef` for a `GenericMemory`. See [`MemoryRef`](@ref).
29+
Return a `GenericMemoryRef` for a `GenericMemory`. See [`memoryref`](@ref).
3030
3131
!!! compat "Julia 1.11"
3232
This function requires Julia 1.11 or later.
3333
"""
34-
Core.memoryref
34+
Core.memoryrefnew
3535

3636
"""
3737
Core..memoryrefoffset(::GenericMemoryRef)
3838
39-
Return the offset index that was used to construct the `MemoryRef`. See [`Core.memoryref`](@ref).
39+
Return the offset index that was used to construct the `MemoryRef`. See [`memoryref`](@ref).
4040
4141
!!! compat "Julia 1.11"
4242
This function requires Julia 1.11 or later.

base/essentials.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3-
using Core: CodeInfo, SimpleVector, donotdelete, compilerbarrier, memoryref, memoryrefget, memoryrefset!
3+
using Core: CodeInfo, SimpleVector, donotdelete, compilerbarrier, memoryrefnew, memoryrefget, memoryrefset!
44

55
const Callable = Union{Function,Type}
66

@@ -361,7 +361,7 @@ default_access_order(a::GenericMemoryRef{:not_atomic}) = :not_atomic
361361
default_access_order(a::GenericMemoryRef{:atomic}) = :monotonic
362362

363363
getindex(A::GenericMemory, i::Int) = (@_noub_if_noinbounds_meta;
364-
memoryrefget(memoryref(memoryref(A), i, @_boundscheck), default_access_order(A), false))
364+
memoryrefget(memoryrefnew(memoryrefnew(A), i, @_boundscheck), default_access_order(A), false))
365365
getindex(A::GenericMemoryRef) = memoryrefget(A, default_access_order(A), @_boundscheck)
366366

367367
"""
@@ -892,16 +892,16 @@ end
892892
function getindex(A::Array, i::Int)
893893
@_noub_if_noinbounds_meta
894894
@boundscheck ult_int(bitcast(UInt, sub_int(i, 1)), bitcast(UInt, length(A))) || throw_boundserror(A, (i,))
895-
memoryrefget(memoryref(getfield(A, :ref), i, false), :not_atomic, false)
895+
memoryrefget(memoryrefnew(getfield(A, :ref), i, false), :not_atomic, false)
896896
end
897897
# simple Array{Any} operations needed for bootstrap
898898
function setindex!(A::Array{Any}, @nospecialize(x), i::Int)
899899
@_noub_if_noinbounds_meta
900900
@boundscheck ult_int(bitcast(UInt, sub_int(i, 1)), bitcast(UInt, length(A))) || throw_boundserror(A, (i,))
901-
memoryrefset!(memoryref(getfield(A, :ref), i, false), x, :not_atomic, false)
901+
memoryrefset!(memoryrefnew(getfield(A, :ref), i, false), x, :not_atomic, false)
902902
return A
903903
end
904-
setindex!(A::Memory{Any}, @nospecialize(x), i::Int) = (memoryrefset!(memoryref(memoryref(A), i, @_boundscheck), x, :not_atomic, @_boundscheck); A)
904+
setindex!(A::Memory{Any}, @nospecialize(x), i::Int) = (memoryrefset!(memoryrefnew(memoryrefnew(A), i, @_boundscheck), x, :not_atomic, @_boundscheck); A)
905905
setindex!(A::MemoryRef{T}, x) where {T} = (memoryrefset!(A, convert(T, x), :not_atomic, @_boundscheck); A)
906906
setindex!(A::MemoryRef{Any}, @nospecialize(x)) = (memoryrefset!(A, x, :not_atomic, @_boundscheck); A)
907907

base/exports.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ export
549549
mapfoldl,
550550
mapfoldr,
551551
mapreduce,
552+
memoryref,
552553
merge!,
553554
mergewith!,
554555
merge,

0 commit comments

Comments
 (0)