On Sun, Nov 17, 2013 at 07:12:12PM +0800, Åke Kullenberg 
<[email protected]> wrote:
> For example, I allocate memory on the heap for a watcher, but later on I
> want to move the watcher to another place on the heap. I would assume
> libev's internal data structures don't allow for this while the watcher is
> started, but how about when it's stopped? Is this assumption correct? If
> not, how can it be done?

This is indeed not documented either way. I'll discuss this with my
co-designer. In any case, this would indeed only be allowed when they are
not active (e.g. after an explciit ev_xxx_stop).

In the meantime, since watchers have very little state, you could copy
them by calling ev_xxx_init with the values from the old watcher and be
safe no matter how the verdict turns out :)

For example, to copy an I/O watcher, you can do this:

   ev_io_init (&new, ev_cb (&old), old.fd, old.events);

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      [email protected]
      -=====/_/_//_/\_,_/ /_/\_\

_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to