[PATCH weston v6 11/12] Enforce destruction of all backend config objects after initialization

Pekka Paalanen ppaalanen at gmail.com
Mon Apr 18 12:40:15 UTC 2016


On Sun, 17 Apr 2016 17:22:50 +0300
Giulio Camuffo <giuliocamuffo at gmail.com> wrote:

> Maybe it would make sense to squash this too, but either way:
> Reviewed-by: Giulio Camuffo <giuliocamuffo at gmail.com>
> 
> 2016-04-16 6:28 GMT+03:00 Bryce Harrington <bryce at osg.samsung.com>:
> > Since the backend config struct versioning implies that there we expect
> > potential future descrepancy between main's definition of the config
> > object and the backend's, don't allow the backend to hang onto the
> > config object outside the initialization scope.
> >
> > Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
> > Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> >
> > v6:
> >  - Put backend configs on stack instead of zalloc()
> >
> > Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
> > ---
> >  src/main.c | 113 ++++++++++++++++++++++++++++---------------------------------
> >  1 file changed, 51 insertions(+), 62 deletions(-)
> >
> > diff --git a/src/main.c b/src/main.c
> > index dcd5ee6..9a8094f 100644
> > --- a/src/main.c
> > +++ b/src/main.c
> > @@ -657,7 +657,20 @@ load_backend_old(struct weston_compositor *compositor, const char *backend,
> >         return backend_init(compositor, argc, argv, wc, NULL);
> >  }
> >
> > -/* Temporary function to be replaced by weston_compositor_load_backend(). */
> > +/** Main module call-point for backends.
> > + *
> > + * All backends should use this routine to access their init routine.
> > + * Backends may subclass weston_backend_config to add their own
> > + * configuration data, setting the major/minor version in config_base
> > + * accordingly.
> > + *
> > + * The config_base object should be treated as temporary, and any data
> > + * copied out of it by backend_init before returning.  The load_backend_new
> > + * callers may then free the config_base object.
> > + *
> > + * NOTE: This is a temporary function intended to eventually be replaced
> > + * by weston_compositor_load_backend().
> > + */
> >  static int
> >  load_backend_new(struct weston_compositor *compositor, const char *backend,
> >                  struct weston_backend_config *config_base)

Hi,

I took the liberty to squash the headless part of this patch into the
headless conversion patch.

Furthermore I took the above documentation hunk for load_backend_new()
and pushed it upstream as a patch of its own:
   20b66c3..3c53094  master -> master

With all the splitting and squashing I understand it creates some
rebasing conflicts, so here is a rebased branch of the remaining patches
in this series:
https://git.collabora.com/cgit/user/pq/weston.git/log/?h=libweston-config-v6-rebased

I hope it saves you the extra effort my fiddling created when revising
the rest of the patches.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160418/0bdeb29a/attachment.sig>


More information about the wayland-devel mailing list