Skip to content

Commit 3abdf3b

Browse files
committed
Address array package truffle-sharing warnings
1 parent 0248ce8 commit 3abdf3b

File tree

5 files changed

+99
-94
lines changed

5 files changed

+99
-94
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import com.oracle.truffle.api.dsl.Bind;
1717
import com.oracle.truffle.api.dsl.Cached;
18+
import com.oracle.truffle.api.dsl.Cached.Shared;
1819
import com.oracle.truffle.api.dsl.ImportStatic;
1920
import com.oracle.truffle.api.dsl.Specialization;
2021
import com.oracle.truffle.api.library.CachedLibrary;
@@ -28,7 +29,7 @@ public abstract class ArrayEnsureCapacityNode extends RubyBaseNode {
2829
protected Object ensureCapacityAndMakeMutable(RubyArray array, int requiredCapacity,
2930
@Bind("array.getStore()") Object store,
3031
@CachedLibrary("store") ArrayStoreLibrary stores,
31-
@Cached CountingConditionProfile extendProfile) {
32+
@Cached @Shared CountingConditionProfile extendProfile) {
3233
final int currentCapacity = stores.capacity(store);
3334
final int capacity;
3435
if (extendProfile.profile(currentCapacity < requiredCapacity)) {
@@ -47,7 +48,7 @@ protected Object ensureCapacityAndMakeMutable(RubyArray array, int requiredCapac
4748
protected Object ensureCapacity(RubyArray array, int requiredCapacity,
4849
@Bind("array.getStore()") Object store,
4950
@CachedLibrary("store") ArrayStoreLibrary stores,
50-
@Cached CountingConditionProfile extendProfile) {
51+
@Cached @Shared CountingConditionProfile extendProfile) {
5152
final int length = stores.capacity(store);
5253
if (extendProfile.profile(length < requiredCapacity)) {
5354
final int capacity = ArrayUtils.capacity(getLanguage(), length, requiredCapacity);

0 commit comments

Comments
 (0)