Commits
- Commit:
cc44e26db4154e11a027442878e1e34bc521e58e
- From:
- Omar Polo <op@omarpolo.com>
- Date:
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.
- Commit:
c7ef47709b71c178743625c10feca9f7cf373b80
- From:
- Omar Polo <op@omarpolo.com>
- Date:
ev_timer_cancel: return -1 when not found
- Commit:
edaadfbc3f3aa875d02f68b858ac44b128898f79
- From:
- Omar Polo <op@omarpolo.com>
- Date:
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.
- Commit:
04ffa662adc8ee1b45fcd633c519bbe21f78f93a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
ev: fix corruption in bubbledown
tmp is of the wrong size, so we memcpy the wrong values. fun.
- Commit:
f47e9216ca57a589fd5c47edb614b7385bde87ae
- From:
- Omar Polo <op@omarpolo.com>
- Date:
ev: fix two off-by-one in bubbledown
- Commit:
12d24edabcafcd71848612b2bc09a5ceeff5ef36
- From:
- Omar Polo <op@omarpolo.com>
- Date:
ev: fix registering timers from timers callbacks
We can't add items to the heap while we've iterating it, so we can't
directly insert new times from a timer' callback. Instead, add
them to a ``reserve'' space after the end of the heap, and merge
them back inside the heap after all events have been processed.
- Commit:
21c9672d65fdfef303bd8dd6b699c13d19118c22
- From:
- Omar Polo <op@omarpolo.com>
- Date:
ev: fix invalid fd check
- Commit:
c48cf63883dde2f28bca9aa8b97e0bcd94b071ff
- From:
- Omar Polo <op@omarpolo.com>
- Date:
ev: define EV_* constants instead of reusing POLL{IN,OUT}
Dissociate us a bit from poll(2) so that we may even run on top of
something else, and also allows to provide specific values for
signal (EV_SIGNAL) and timers (EV_TIMEOUT).
- Commit:
f436aa54ddf3e9824f825a23aeb42cbc147d7fcc
- From:
- Omar Polo <op@omarpolo.com>
- Date:
import ev.[ch]
from syncparty and amused; locally tweaked to support an arbitrary
number of timers.