How do I cancel a timer?

ryah dahl ry at tinyclouds.org
Fri Dec 19 02:30:04 CET 2008


Graham,

libev is a performance-oriented library; since allocations can be a
bottleneck and can be handled in many different ways, the library uses
a common pattern and gives memory control to the user. Perhaps the
user wants to allocate only a fixed number of watchers statically,
perhaps they use a memory pool, or perhaps they just use malloc - all
of these use cases are supported by ev_*_init.

The mistake checking you want could be added with very much overhead
(keeping a list of all the pointers initialized, and adding a
ev_*_deinit function? putting a checksum in the structure?), but that
would negate the point of giving user memory control in the first
place. Also, no one needs it because it's clear from the outset that
managing watcher memory is the user's job.

If you had read the manual or looked at the source code you'd realize
libev is filled with assertions.



More information about the libev mailing list