Skip to content

Commit 44b544e

Browse files
committed
do not read from the contextRef for checking if we need to report allocation, only check if we have one
1 parent 42f998a commit 44b544e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/object/PythonObjectFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,20 @@ public NodeCost getCost() {
154154
}
155155

156156
public PythonCore getCore() {
157-
return getContext().getCore();
157+
return getContextRef().get().getCore();
158158
}
159159

160-
private PythonContext getContext() {
160+
private ContextReference<PythonContext> getContextRef() {
161161
if (contextRef == null) {
162162
CompilerDirectives.transferToInterpreterAndInvalidate();
163163
contextRef = PythonLanguage.getContextRef();
164164
allocationReporter = contextRef.get().getEnv().lookup(AllocationReporter.class);
165165
}
166-
return contextRef.get();
166+
return contextRef;
167167
}
168168

169169
private boolean reportAllocations() {
170-
return getContext() != null && allocationReporter != null;
170+
return getContextRef() != null && allocationReporter != null;
171171
}
172172

173173
/*

0 commit comments

Comments
 (0)