[PATCH wayland 0/7] Add support for custom dispatchers

Kristian Høgsberg hoegsberg at gmail.com
Thu Feb 7 18:07:06 PST 2013


On Fri, Feb 01, 2013 at 10:09:41AM -0600, Jason Ekstrand wrote:
> Ths patch group contains my additions for custom dispatcher support inside
> libwayland.  This would allow someone to handle event and resource function
> calling at runtime rather than through a list of function pointers and libffi.
> The primary use case for these modifications is to enable much more flexible
> binding to non-C languages.
> 
> As far as I am concerned, these patches are ready for commit.  All unit tests
> pass including new ones.  Also, weston successfully builds and runs against
> this version.
> 
> Concerning ABI: I can't see why any programs built against earlier versions
> should break with these changes.  If patch 5 (for wayland-scanner) is omitted,
> earlier version of weston built against 1.0.4 work in spite of complaining
> about different sized structures in the shared object.  With patch 5, they
> segfault because the version is above 1 but the dispatcher is not null.  I'm
> not seeing why this happens but it may be that I don't understand ABI's well
> enough.

Hi Jason,

Just a quick comment on this: I quite like the direction this is
taking, the marshalling code is simpler overall and the libffi code is
better isolated.  The only concern I have is that we seem to be doing
quite a few more copies of all the arguments now.  That's likely not a
concern in the bigger picture, but it seems like in one case we should
be able to allocate a wl_closure up front and then vmarshal straight
into the arg array there instead of a temp array.

Kristian

> Jason Ekstrand (7):
>   Make a #define for WL_CLOSURE_MAX_ARGS instead of a magic number.
>   Add a default dispatcher function and related test
>   Convert wl_closure to use wl_argument and enable dispatchers
>   Fill out dummy objects in tests so dispatchers will work
>   Make the scanner generate version 1 wl_interface structures
>   Add wl_arguments forms of wl_resource_post_event and
>     wl_resource_queue_event
>   Test for proper usage of custom vs. default dispatchers
> 
>  src/connection.c         | 421 ++++++++++++++++++++++++++++-------------------
>  src/scanner.c            |   3 +-
>  src/wayland-client.c     |  29 ++--
>  src/wayland-private.h    |  20 ++-
>  src/wayland-server.c     |  69 ++++----
>  src/wayland-server.h     |   4 +
>  src/wayland-util.h       |  38 ++++-
>  tests/.gitignore         |   1 +
>  tests/Makefile.am        |   2 +
>  tests/connection-test.c  |  35 +++-
>  tests/dispatcher-test.c  | 163 ++++++++++++++++++
>  tests/os-wrappers-test.c |  11 +-
>  12 files changed, 566 insertions(+), 230 deletions(-)
>  create mode 100644 tests/dispatcher-test.c
> 
> -- 
> 1.8.1
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list