[PATCH weston 01/11] tests: introduce struct buffer for client-helper

Pekka Paalanen ppaalanen at gmail.com
Thu Jun 23 12:13:51 UTC 2016


On Thu, 23 Jun 2016 18:07:49 +1000
Daniel Stone <daniel at fooishbar.org> wrote:

> Hi,
> 
> On 17 June 2016 at 00:13, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> > Create a new struct buffer to encapsulate the image representation, the
> > wl_buffer, and enough information to tear it all down (munmap) so we
> > don't have to leak everything. Some tests might start doing things in
> > loops, and leaking would accumulate.
> >
> > Instead of inventing our own image representation, use pixman_image_t.
> > It is a well-tested library worth using, and we already rely on it in
> > other places.  
> 
> Smashing these two changes together does make this patch rather hard
> to review. :(

Hi,

yeah, well, if I just made a
struct buffer {
	struct wl_buffer *proxy;
	void *data;
};

with an almost empty buffer_destroy() first, we'd have just the renames
from wl_buffer to buffer.proxy and data to buffer.data in the first
patch, plus fixing up all uses of data once. Then the second patch
would change all the uses of data again. I like to avoid changing the
same thing multiple times in the same series.

> It's not a blocker for me, since I did manage to convince myself it's
> fairly correct, but the entanglement is really unfortunate.

Ok.

> The screenshot buffer is still leaked, but that was the case originally, so ...

Leaking stuff is more of a rule than exception in tests so far.


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/20160623/1a29a6d2/attachment.sig>


More information about the wayland-devel mailing list