Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Sep 07, 2010

  1. Actually make the shadow tables work, and add a test to prove it.

    authored September 07, 2010

Sep 06, 2010

  1. Integrate Brian Downing's changes in, making the following

     * Change the implementation of the "shadow" user data so that only
       users of this functionality pay for the extra overhead of a lua
       table for every watcher.
     * Simplify how a watcher is "checked" so that it simply looks for
       a magic key in the metatable to determine if it is of the right
     * Require libev 3.7 (print a warning if this version is not
       satisfied).  This version is required in order to set userdata on
       an event loop.
     * Instead of having a separate watcher metatable, simply mix-in the
       watcher metatable methods.
     * Add note about calling ev_loop() directly from C.
    TODO: Is the loop specific shadow user data desired?  If not, then
    the obj_index and obj_newindex should be renamed watcher_index and
    authored September 06, 2010

Aug 30, 2010

  1. Brian Downing

    Lazily create the shadow table for lua-ev objects

    Previously we created the shadow table (which allows storing arbitrary
    values on lua-ev objects) immediately on object creation.  Through the
    clever use of a __newindex function, we can create this table lazily,
    saving the cost of the table for users who do not use this functionality.
    authored August 30, 2010

Aug 28, 2010

  1. Brian Downing

    Clean up lua-ev warnings

    authored August 28, 2010
  2. Brian Downing

    Make obj_check search metatable ancestry

    This is in preparation for making a true WATCHER_MT superclass.
    authored August 27, 2010
  3. Brian Downing

    Add support for storing arbitrary values in lua-ev objects

    One thing missing from lua-ev that is present in "raw" libev is being
    able to associate arbitrary user data with loops and watchers.  In Lua
    this can be worked around by using closures or object-keyed tables,
    but this can sometimes be inconvenient.
    This patch modifies the metatable arrangement of lua-ev objects to allow
    for storing arbitrary data.  Rather than simply:
        setmetatable(obj, luaL_getmetatable("tname"))
    we do:
        class = luaL_getmetatable("tname")
        shadow = setmetatable({ }, class)
        fenv = { __gc = class.__gc, __index = shadow, __newindex = shadow }
        setfenv(obj, fenv)
        setmetatable(obj, fenv)
    This only costs one extra table per object, since every object already
    had an fenv used in a way compatible with the above.  Also, since the
    shadow table isn't the metatable, setting arbitrary parameters won't do
    anything unexpected (like killing the __gc method for a loop).
    This results in a very easy and intuitive method of storing userdata in
    libev objects - basically, they can just be treated as tables.
    authored August 27, 2010

Feb 15, 2010

  1. Brian Maher

    Fix compile errors and get tests to succeed.

    authored February 14, 2010

Feb 13, 2010

  1. Brian Maher

    Complete refactoring (aka rewrite). Never compiled yet.

    authored February 13, 2010
Something went wrong with that request. Please try again.