[Xcb] xcb_setup_roots_iterator
Ben Hildred
42656e at gmail.com
Sat Jul 18 16:10:13 PDT 2015
On Sat, Jul 18, 2015 at 4:24 PM, Alan Coopersmith <
alan.coopersmith at oracle.com> wrote:
> On 07/18/15 10:19 AM, Ben Hildred wrote:
>
>> On Sat, Jul 18, 2015 at 9:42 AM, Alan Coopersmith <
>> alan.coopersmith at oracle.com
>> <mailto:alan.coopersmith at oracle.com>> wrote:
>> xcb_setup_roots_iterator just sets up a small structure with pointers
>> to the
>> list of roots in the xcb_setup_t and the mechanism to walk it without
>> exposing
>> the structure details to callers.
>>
>>
>> and that explains a lot of the examples, I have seen the walker function
>> too,
>> but I have not seen a corresponding free function. Does it set up the
>> indexes in
>> the connection structure or is that fourth line just a small memory leak
>> as only
>> the data member is used or saved and the structure returned never freed?
>>
>
> It appears to return a structure, not a pointer to a structure, so callers
> are
> responsible for allocating & freeing space for that structure to be copied
> into,
> and I expect most are doing so on their stack instead of via malloc.
> (Honestly,
> I'd not noticed that bit of it's API before, so I may have misunderstood
> it.)
>
> If it is a structure that is returned then we don't have a memory leak
(presuming the compiler can actually pass structures without putting it's
foot in it). Thanks for all your help. I have also contributed some to the
perl package X11::XCB which is an xcb wrapper that may someday be complete.
> --
> -Alan Coopersmith- alan.coopersmith at oracle.com
> Oracle Solaris Engineering - http://blogs.oracle.com/alanc
>
Nice, blog. I have added it to my feed reader.
--
--
Ben Hildred
Automation Support Services
303 815 6721
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20150718/9d15245a/attachment.html>
More information about the Xcb
mailing list