4c9406964425ecc33fac38bb093e236b43b449e6 |
|
22-May-2000 |
Andreas Gustafsson <source@isc.org> |
199. [bug] isc_heap_delete() sometimes violated the heap
invariant, causing timer events not to be posted
when due.
Specifically, isc_heap_delete() moved the last element of the heap to
the vacated position and then attempted to restore the heap invariant
by calling sink_down(). This works when the last element has a lower
priority than the one being deleted, and this is often the case
because the last element tends to have a low priority. However, it is
not guaranteed to be the lowest. When deleting an item of a lower
priority than the last item, restoring the invariant requires a call
to float_up(), not sink_down().
isc_heap_delete_now calls either float_up() or sink_down() as needed,
and INSISTs have been added to verify that the heap invariant indeed
holds after the calls. |