Skip to content

Commit 2d5d7cf

Browse files
committed
Fix sharing in a couple more places.
1 parent 809912a commit 2d5d7cf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/org/truffleruby/core/array/ArrayNodes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ protected RubyArray mulOther(RubyArray array, int count,
184184
} catch (ArithmeticException e) {
185185
throw new RaiseException(getContext(), coreExceptions().rangeError("new array size too large", this));
186186
}
187-
final Object newStore = arrays.allocator(store).allocate(newSize);
187+
final Object newStore = arrays.unsharedAllocator(store).allocate(newSize);
188188
int n = 0;
189189
try {
190190
for (; loopProfile.inject(n < count); n++) {
@@ -2217,7 +2217,7 @@ protected RubyArray sortVeryShort(VirtualFrame frame, RubyArray array, Nil block
22172217
@Cached DispatchNode compareDispatchNode,
22182218
@Cached CmpIntNode cmpIntNode) {
22192219
final Object newStore = stores
2220-
.allocator(store)
2220+
.unsharedAllocator(store)
22212221
.allocate(getContext().getOptions().ARRAY_SMALL);
22222222
final int size = arraySizeProfile.profile(array.size);
22232223

src/main/java/org/truffleruby/core/array/library/ZeroLengthArrayStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ protected static Object allocateForNewStore(ZeroLengthArrayStore store, Object n
214214
// We have to be careful here in case newStore is a a
215215
// wrapped version of the zero length store, and we don't
216216
// want to end up recursing back to this case repeatedly.
217-
return newStores.allocateForNewStore(newStore, store, length);
217+
return newStores.unsharedAllocateForNewStore(newStore, store, length);
218218
}
219219

220220
protected static boolean zeroLengthStore(Object store) {

0 commit comments

Comments
 (0)