File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -3195,6 +3195,12 @@ long doPInt(PInt object) {
3195
3195
return ((PInt .bitLength (object .abs ()) - 1 ) / PythonContext .get (this ).getCApiContext ().getPyLongBitsInDigit () + 1 ) * (object .isNegative () ? -1 : 1 );
3196
3196
}
3197
3197
3198
+ @ Specialization
3199
+ static long doPythonNativeVoidPtr (@ SuppressWarnings ("unused" ) PythonNativeVoidPtr object ,
3200
+ @ Shared ("context" ) @ CachedContext (PythonLanguage .class ) PythonContext context ) {
3201
+ return ((Long .SIZE - 1 ) / context .getCApiContext ().getPyLongBitsInDigit () + 1 );
3202
+ }
3203
+
3198
3204
@ Specialization (guards = "isFallback(object)" )
3199
3205
static long doOther (Object object ,
3200
3206
@ Cached PyObjectSizeNode sizeNode ) {
@@ -3206,7 +3212,7 @@ static long doOther(Object object,
3206
3212
}
3207
3213
3208
3214
static boolean isFallback (Object object ) {
3209
- return !(object instanceof PInt || object instanceof Integer || object instanceof Long );
3215
+ return !(object instanceof PInt || object instanceof Integer || object instanceof Long || object instanceof PythonNativeVoidPtr );
3210
3216
}
3211
3217
}
3212
3218
You can’t perform that action at this time.
0 commit comments