Skip to content

Commit 06e76c6

Browse files
committed
Cleanup
1 parent 8da1df4 commit 06e76c6

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/main/java/org/truffleruby/cext/ValueWrapperManager.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ public final class ValueWrapperManager {
6464

6565
private volatile HandleBlockWeakReference[] blockMap = new HandleBlockWeakReference[0];
6666

67-
public static HandleBlockHolder getBlockHolder(RubyContext context, RubyLanguage language) {
67+
public static HandleBlockHolder getBlockHolder(RubyLanguage language) {
6868
return language.getCurrentFiber().handleData;
6969
}
7070

7171
@TruffleBoundary
72-
public synchronized HandleBlock addToBlockMap(RubyContext context, RubyLanguage language) {
73-
HandleBlock block = new HandleBlock(context, language, this);
72+
public synchronized HandleBlock addToBlockMap(RubyLanguage language) {
73+
HandleBlock block = new HandleBlock(language, this);
7474
int blockIndex = block.getIndex();
7575
HandleBlockWeakReference[] map = growMapIfRequired(blockMap, blockIndex);
7676
blockMap = map;
@@ -80,9 +80,9 @@ public synchronized HandleBlock addToBlockMap(RubyContext context, RubyLanguage
8080
}
8181

8282
@TruffleBoundary
83-
public HandleBlock addToSharedBlockMap(RubyContext context, RubyLanguage language) {
83+
public HandleBlock addToSharedBlockMap(RubyLanguage language) {
8484
synchronized (language) {
85-
HandleBlock block = new HandleBlock(context, language, this);
85+
HandleBlock block = new HandleBlock(language, this);
8686
int blockIndex = block.getIndex();
8787
HandleBlockWeakReference[] map = growMapIfRequired(language.handleBlockSharedMap, blockIndex);
8888
language.handleBlockSharedMap = map;
@@ -143,7 +143,7 @@ public void freeAllBlocksInMap() {
143143
}
144144
}
145145

146-
public void cleanup(RubyContext context, HandleBlockHolder holder) {
146+
public void cleanup(HandleBlockHolder holder) {
147147
holder.handleBlock = null;
148148
}
149149

@@ -205,7 +205,7 @@ public static final class HandleBlock {
205205

206206
@SuppressWarnings("unused") private Cleanable cleanable;
207207

208-
public HandleBlock(RubyContext context, RubyLanguage language, ValueWrapperManager manager) {
208+
public HandleBlock(RubyLanguage language, ValueWrapperManager manager) {
209209
HandleBlockAllocator allocator = language.handleBlockAllocator;
210210
long base = allocator.getFreeBlock();
211211
this.base = base;
@@ -287,7 +287,7 @@ static long allocateHandleOnKnownThread(Node node, ValueWrapper wrapper) {
287287
wrapper,
288288
getContext(node),
289289
getLanguage(node),
290-
getBlockHolder(getContext(node), getLanguage(node)),
290+
getBlockHolder(getLanguage(node)),
291291
false);
292292
}
293293

@@ -301,7 +301,7 @@ static long allocateSharedHandleOnKnownThread(Node node, ValueWrapper wrapper) {
301301
wrapper,
302302
getContext(node),
303303
getLanguage(node),
304-
getBlockHolder(getContext(node), getLanguage(node)),
304+
getBlockHolder(getLanguage(node)),
305305
true);
306306
}
307307

@@ -329,10 +329,10 @@ protected static long allocateHandle(Node node, ValueWrapper wrapper, RubyContex
329329

330330
if (block == null || block.isFull()) {
331331
if (shared) {
332-
block = context.getValueWrapperManager().addToSharedBlockMap(context, language);
332+
block = context.getValueWrapperManager().addToSharedBlockMap(language);
333333
holder.sharedHandleBlock = block;
334334
} else {
335-
block = context.getValueWrapperManager().addToBlockMap(context, language);
335+
block = context.getValueWrapperManager().addToBlockMap(language);
336336
holder.handleBlock = block;
337337
}
338338

@@ -346,8 +346,8 @@ protected static boolean isSharedObject(ValueWrapper wrapper) {
346346
}
347347

348348
public static HandleBlock allocateNewBlock(RubyContext context, RubyLanguage language) {
349-
HandleBlockHolder holder = getBlockHolder(context, language);
350-
HandleBlock block = context.getValueWrapperManager().addToBlockMap(context, language);
349+
HandleBlockHolder holder = getBlockHolder(language);
350+
HandleBlock block = context.getValueWrapperManager().addToBlockMap(language);
351351

352352
holder.handleBlock = block;
353353
return block;

src/main/java/org/truffleruby/core/fiber/FiberManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public void start(RubyFiber fiber, Thread javaThread) {
353353
}
354354

355355
public void cleanup(RubyFiber fiber, Thread javaThread) {
356-
context.getValueWrapperManager().cleanup(context, fiber.handleData);
356+
context.getValueWrapperManager().cleanup(fiber.handleData);
357357

358358
fiber.status = FiberStatus.TERMINATED;
359359

0 commit comments

Comments
 (0)