ISO: A good example of associating custom data with a watcher (timer, etc.)

Chris Galas ChrisG at nytec.com
Tue Dec 1 00:32:48 CET 2015


I'm looking for a good 'c' example of associating custom data with a watcher, say an ev_timer.

I subclass the ev_timer struct and then add my own data to the end. What will insure the 'base' come first in memory versus my own data?

typedef struct ev_mytimer
{
  struct ev_timer base;
  void* myData;
} ev_mytimer;

Thanks!



More information about the libev mailing list