@@ -491,7 +491,7 @@ mark_alive_stack_push(PyObject *op, _PyObjectStack *stack)
491
491
}
492
492
493
493
#ifdef GC_MARK_ALIVE_STACKS
494
- static bool
494
+ static int
495
495
gc_visit_stackref_mark_alive (_PyObjectStack * stack , _PyStackRef stackref )
496
496
{
497
497
// Note: we MUST check that it is deferred before checking the rest.
@@ -500,13 +500,13 @@ gc_visit_stackref_mark_alive(_PyObjectStack *stack, _PyStackRef stackref)
500
500
if (PyStackRef_IsDeferred (stackref ) && !PyStackRef_IsNull (stackref )) {
501
501
PyObject * op = PyStackRef_AsPyObjectBorrow (stackref );
502
502
if (mark_alive_stack_push (op , stack ) < 0 ) {
503
- return false ;
503
+ return -1 ;
504
504
}
505
505
}
506
- return true ;
506
+ return 0 ;
507
507
}
508
508
509
- static bool
509
+ static int
510
510
gc_visit_thread_stacks_mark_alive (PyInterpreterState * interp , _PyObjectStack * stack )
511
511
{
512
512
_Py_FOR_EACH_TSTATE_BEGIN (interp , p ) {
@@ -518,18 +518,18 @@ gc_visit_thread_stacks_mark_alive(PyInterpreterState *interp, _PyObjectStack *st
518
518
519
519
PyCodeObject * co = (PyCodeObject * )executable ;
520
520
int max_stack = co -> co_nlocalsplus + co -> co_stacksize ;
521
- if (! gc_visit_stackref_mark_alive (stack , f -> f_executable )) {
522
- return false ;
521
+ if (gc_visit_stackref_mark_alive (stack , f -> f_executable ) < 0 ) {
522
+ return -1 ;
523
523
}
524
524
for (int i = 0 ; i < max_stack ; i ++ ) {
525
- if (! gc_visit_stackref_mark_alive (stack , f -> localsplus [i ])) {
526
- return false ;
525
+ if (gc_visit_stackref_mark_alive (stack , f -> localsplus [i ]) < 0 ) {
526
+ return -1 ;
527
527
}
528
528
}
529
529
}
530
530
}
531
531
_Py_FOR_EACH_TSTATE_END (interp );
532
- return true ;
532
+ return 0 ;
533
533
}
534
534
#endif // GC_MARK_ALIVE_STACKS
535
535
#endif // GC_ENABLE_MARK_ALIVE
@@ -918,7 +918,7 @@ mark_alive_from_roots(PyInterpreterState *interp,
918
918
}
919
919
#endif
920
920
#ifdef GC_MARK_ALIVE_STACKS
921
- if (! gc_visit_thread_stacks_mark_alive (interp , & stack )) {
921
+ if (gc_visit_thread_stacks_mark_alive (interp , & stack ) < 0 ) {
922
922
return -1 ;
923
923
}
924
924
#endif
0 commit comments