{
/* new tuple <= top of the heap, so we can discard it */
free_sort_tuple(state, tuple);
+ CHECK_FOR_INTERRUPTS();
}
else
{
{
/* New tuple would just get thrown out, so skip it */
free_sort_tuple(state, &state->memtuples[i]);
+ CHECK_FOR_INTERRUPTS();
}
else
{
memtuples = state->memtuples;
Assert(state->memtupcount < state->memtupsize);
+ CHECK_FOR_INTERRUPTS();
+
/*
* Sift-up the new entry, per Knuth 5.2.3 exercise 16. Note that Knuth is
* using 1-based array indexes, not 0-based.
if (--state->memtupcount <= 0)
return;
+
+ CHECK_FOR_INTERRUPTS();
+
n = state->memtupcount;
tuple = &memtuples[n]; /* tuple that must be reinserted */
i = 0; /* i is where the "hole" is */