File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
src/compiler/crystal/codegen Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ require " spec"
2+ require " ../support/finalize"
3+ require " ../support/interpreted"
4+
5+ private class Inner
6+ include FinalizeCounter
7+
8+ def initialize (@key : String )
9+ end
10+ end
11+
12+ private class Outer
13+ @inner = Inner .new(" reference-storage" )
14+ end
15+
16+ describe " Primitives: pointer" do
17+ describe " .malloc" do
18+ pending_interpreted " is non-atomic for ReferenceStorage(T) if T is non-atomic (#14692)" do
19+ FinalizeState .reset
20+ outer = Outer .unsafe_construct(Pointer (ReferenceStorage (Outer )).malloc(1 ))
21+ GC .collect
22+ FinalizeState .count(" reference-storage" ).should eq(0 )
23+ end
24+ end
25+ end
Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ module Crystal
6969 self .tuple_types.any? & .has_inner_pointers?
7070 when NamedTupleInstanceType
7171 self .entries.any? & .type.has_inner_pointers?
72+ when ReferenceStorageType
73+ self .reference_type.has_inner_pointers?
7274 when PrimitiveType
7375 false
7476 when EnumType
You can’t perform that action at this time.
0 commit comments