Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 70d4478

Browse files
committed
Only call sigcheck() at the ticker code if we don't have true signals.
This is safe now that both intrcheck() and signalmodule.c schedule a sigcheck() call via Py_AddPendingCall(). This gives another 7% speedup (never run such a test twice ;-).
1 parent fcdd0e4 commit 70d4478

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Python/ceval.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ static object *apply_subscript PROTO((object *, object *));
9292
static object *loop_subscript PROTO((object *, object *));
9393
static int slice_index PROTO((object *, int, int *));
9494
static object *apply_slice PROTO((object *, object *, object *));
95-
static object *build_slice PROTO((object *, object *, object *));
9695
static int assign_subscript PROTO((object *, object *, object *));
9796
static int assign_slice PROTO((object *, object *, object *, object *));
9897
static int cmp_exception PROTO((object *, object *));
@@ -557,7 +556,7 @@ eval_code2(co, globals, locals,
557556
So we do it only every Nth instruction.
558557
559558
The ticker is reset to zero if there are pending
560-
calls (see Py_AddPendingCalls() and
559+
calls (see Py_AddPendingCall() and
561560
Py_MakePendingCalls() above). */
562561

563562
if (--ticker < 0) {
@@ -568,10 +567,15 @@ eval_code2(co, globals, locals,
568567
goto on_error;
569568
}
570569
}
570+
#ifndef HAVE_SIGNAL_H /* Is this the right #define? */
571+
/* If we have true signals, the signal handler will call
572+
Py_AddPendingCall() so we don't have to call sigcheck().
573+
On the Mac and DOS, alas, we have to call it. */
571574
if (sigcheck()) {
572575
why = WHY_EXCEPTION;
573576
goto on_error;
574577
}
578+
#endif
575579

576580
#ifdef WITH_THREAD
577581
if (interpreter_lock) {

0 commit comments

Comments
 (0)