File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -80,17 +80,16 @@ function _unsetindex!(A::MemoryRef{T}) where T
8080 MemT = typeof (mem)
8181 arrayelem = datatype_arrayelem (MemT)
8282 elsz = datatype_layoutsize (MemT)
83- isboxed = 1 ; isunion = 2
83+ isbits = 0 ; isboxed = 1 ; isunion = 2
84+ arrayelem == isbits && datatype_pointerfree (T:: DataType ) && return A
8485 t = @_gc_preserve_begin mem
8586 p = Ptr {Ptr{Cvoid}} (@inbounds pointer (A))
8687 if arrayelem == isboxed
8788 Intrinsics. atomic_pointerset (p, C_NULL , :monotonic )
8889 elseif arrayelem != isunion
89- if ! datatype_pointerfree (T:: DataType )
90- for j = 1 : Core. sizeof (Ptr{Cvoid}): elsz
91- # XXX : this violates memory ordering, since it writes more than one C_NULL to each
92- Intrinsics. atomic_pointerset (p + j - 1 , C_NULL , :monotonic )
93- end
90+ for j = 1 : Core. sizeof (Ptr{Cvoid}): elsz
91+ # XXX : this violates memory ordering, since it writes more than one C_NULL to each
92+ Intrinsics. atomic_pointerset (p + j - 1 , C_NULL , :monotonic )
9493 end
9594 end
9695 @_gc_preserve_end t
You can’t perform that action at this time.
0 commit comments