[Xcb] patches from Arnaud Fontaine

Jeremy A. Kolb jkolb at brandeis.edu
Fri Mar 28 11:13:31 PDT 2008



On Fri, 28 Mar 2008, Barton C Massey wrote:

> In message <sa54pargcga.fsf at Orfeo.duckcorp.org> you wrote:
>>  At  the  moment, xcb_get_wm_transient()  returns  a  pointer  on a  new
>>  allocated    pointer    on     a    xcb_hints_t    structure    whereas
>>  xcb_get_wm_size_hints() fills  the given xcb_size_hints_t  structure. I
>>  think  that the  behavior of  both  should be  the same:  return a  new
>>  allocated pointer on  a hints structure _or_ fills  the structure given
>>  as a parameter.
>
> I don't have a strong opinion on this.  If it's not causing
> a problem of some kind, I'd be inclined to leave it alone, I
> guess.  But if you want to make it consistent, that's fine
> too---whichever convention folks think is better seems fine
> to me.
>
> Now that I think about it, though, this is probably an
> instance of a more general question.  I suggest we adopt
> Carl Worth's strategy for Cairo, and make things allocate
> their own storage and provide destructor functions to free
> it.  This is the kind of thing we'll want to do as we work
> back through util getting ready for release.
>
> 	Bart

I'm a big fan of this approach.  I fight this with c++ and dlls over on 
the windows side.  We use static methods to create certain classes and 
it's a huge help in keeping everything allocated where it should be.  It's 
different in C of course but having explicit allocating/deallocating 
functions really makes things easier.  It also gives hints to the as to 
what needs to be freed.

Jeremy


More information about the Xcb mailing list