@@ -215,12 +215,12 @@ PyObject* to_sulong(void *o) {
215
215
/** to be used from Java code only; reads native 'ob_type' field */
216
216
void * get_ob_type (PyObject * obj ) {
217
217
PyTypeObject * type = obj -> ob_type ;
218
- if (truffle_is_handle_to_managed (type )) {
218
+ if (! truffle_cannot_be_handle (type )) {
219
219
return resolve_handle (cache , (uint64_t )type );
220
220
} else {
221
221
// we have stored a handle to the Java class in ob_refcnt
222
222
void * handle = (void * )((PyObject * )type )-> ob_refcnt ;
223
- if (truffle_is_handle_to_managed (handle )) {
223
+ if (! truffle_cannot_be_handle (handle )) {
224
224
return resolve_handle (cache , (uint64_t )handle );
225
225
} else {
226
226
// assume handle is a TruffleObject
@@ -248,15 +248,15 @@ uint64_t PyTruffle_Wchar_Size() {
248
248
}
249
249
250
250
void * PyObjectHandle_ForJavaObject (void * cobj , unsigned long flags ) {
251
- if (truffle_is_handle_to_managed (cobj )) {
251
+ if (truffle_cannot_be_handle (cobj )) {
252
252
return truffle_deref_handle_for_managed (cobj );
253
253
}
254
254
return cobj ;
255
255
}
256
256
257
257
/** to be used from Java code only; only creates the deref handle */
258
258
void * PyObjectHandle_ForJavaType (void * ptype ) {
259
- if (truffle_is_handle_to_managed (ptype )) {
259
+ if (truffle_cannot_be_handle (ptype )) {
260
260
return truffle_deref_handle_for_managed (ptype );
261
261
}
262
262
return ptype ;
0 commit comments