Closed davidmoreno closed 8 years ago
Thank you for working on this, David! I only skimmed over the changes, but here are some quick comments:
Hi,
just fixed two of your concerns. Much better now.
About nr2, this refcount normally will be only 0 or 1, as is how many times you created an onion_poller, which is created only once by onion_new, so no problem for a 16 bit value. Anyway I removed the size specification which would make it 32 or 64 depending on arch.
Thanks for the review.
This PR does two things that help some clean up of dirty things we were doing at the poller:
poller_new
, and it will be triggered on timeouts. On each poller use, it checks if the new poller may have an earlier timeout, and if so updates thecurrent_timeout_limit
rearming the timerfd. On each timeout does the actions of the timeout and recalculates thecurrent_timeout_limit
and rearms the timerfd.onion_poller_static_init
/onion_poller_static_deinit
that does a refcount ofpoller_new
andpoller_free
and allocates the necessary dynamic memory or deallocates it. This helps not having memory leaks (although they were controlled).