Commit Briefs
ev: simplify heap management
make ev_timer always use the ``reserve'' space and heapify at the start of the event loop tick. Bonus points for using the better algorithm and remove the unused bubbleup.
ev: fix/improve cancel_timer and ev_timer_cancel
we only reach cancel_timer() for timers in the hap, so delete the unreachable code, and improve what we have. When deleting from the reserve space, just move the last element in the place of the removed one, no need to move everything. It'll be heapified later anyway.
ev: fix corruption in bubbledown
tmp is of the wrong size, so we memcpy the wrong values. fun.
add missing return
otherwise we try to reschedule the socket we've just closed.
convert telescope to use ev instead of libevent
libevent is a very cool library, I like the APIs and enjoy using it. However, telescope is not as large and doesn't have as many file descriptor, so libevent is quite ``too big'' for our needs. ev started as a small event loop on top of poll(2) for amused, and can be used here too, it just needed to grow the ability to handle several timers, as we need quite some on telescope (in fact, we use more timers than fds!)