[waffle] [PATCH 0/3] Add the waffle_teardown API

Emil Velikov emil.l.velikov at gmail.com
Thu Jan 15 05:31:11 PST 2015


On 15 January 2015 at 15:21, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> Hello all,
>
> As mentioned a while back, here is the function waffle_teardown. Its purpose
> is to cleanup the global state (the api_platform variable and the respective
> platform private data).
>
> This makes valgrind a bit happier (-20k of still reachable) and will allow
> the user to use multiple platforms within a single application. For example
>
> static const int32_t init_attribs_list[][] = {
>  { WAFFLE_PLATFORM, WAFFLE_PLATFORM_GLX, 0 },
>  { WAFFLE_PLATFORM, WAFFLE_PLATFORM_X11_EGL, 0 },
> };
>
> for (i = 0, i < ARRAYSIZE(init_attribs_list[]), i++) {
>    waffle_init(WAFFLE_PLATFORM_GLX);
>    ...
>    waffle_teardown()
> }
>
>
>
> I'm not 100% happy with the function name - waffle_teardown, so if you have
> any suggestions please put them forward.
>
> This work has pointed out a bug (leak) in mesa's libGL/dri2 implementation,
> which I'll send a patch for shortly.
>
> The series can be found in my repo in the wip/waffle-teardown branch.
>
Forgot to mention - I would like to make use of this in gl_basic_test,
yet the level of macros is getting the best of me.
If anyone has any tips that would be appreciated.

-Emil


More information about the waffle mailing list