[PATCH 0/4] Add version support to wl_resource

alexl at redhat.com alexl at redhat.com
Thu May 23 10:31:20 PDT 2013


From: Alexander Larsson <alexl at redhat.com>

Unfortunately there seems to be no easy way to add a version
field to wl_resource in a compatible way, even if we are willing
to break the server library API for compositors, as the wl_resource
struct is embedded in a struct in the EGL code in mesa.

Here is a version that uses one of the two pointers in wl_resource.link
as a privat pointer allowing us to put extra info in the wl_resource.
This is an incompatible ABI/API change in the server libraries, as
anything using the wl_resource.link field need to be updated.

There is also a slight cost to this as removal from a singly linked list
is O(n) whereas it is O(1) on doubly linked list, but I don't expect
the wayland lists to become very long, so this is probably ok.

Alexander Larsson (4):
  Add single linked lists wl_slist similar to wl_list
  Convert wl_resource.link to a wl_slink
  wl_resource: Add a private field to wl_resource
  wl_resource: Add version field and getter/setter

 src/wayland-private.h |  4 ++++
 src/wayland-server.c  | 50 +++++++++++++++++++++++++++++++-------
 src/wayland-server.h  | 11 ++++++++-
 src/wayland-util.c    | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++
 src/wayland-util.h    | 24 +++++++++++++++++++
 5 files changed, 146 insertions(+), 9 deletions(-)

-- 
1.8.1.4



More information about the wayland-devel mailing list