[Xcb] Setting the WM_TRANSIENT_FOR property on a window
Peter Harris
pharris at opentext.com
Mon Mar 22 08:26:49 PDT 2010
On 2010-03-22 11:16, Arnaud Fontaine wrote:
>>>>>> Peter Harris <git at peter.is-a-geek.org> writes:
>
> > Mikhail already clarified my point about variable-length arrays.
> > Thanks, Mikhail.
>
> Yes, thanks. I didn't know there was no way to recover in such
> case... Maybe, it's better to use alloca() then.
No, alloca is just as bad. Most alloca implementations behave the same
way as variable-length arrays. The server moved from alloca to malloc
wholesale in 2007 because the server devs got tired of fixing alloca
related crashes one at a time.
My point is that alloca by any other name is still just as prone to
stack overflows.
> Well, I'm thinking about leaving WM_CLASS setter as it is now because
> this function is not going to be called so many times usually (therefore
> this is not a big overhead) and especially because it's easier to
> maintain (for now I do think it's better to focus on maintainability as
> this library is not widely used yet). I will leave a comment in the
> code quoting what you said though... If performance really matters at
> some point, then we will simply use this solution. What do you think?
Sounds sensible.
> Might be a silly question which has already been discussed, but why is
> iovec needed? I have never had a deep look into core xcb code. Thanks!
iovec lets you submit many separate buffers as if they were one large
one. It is needed to avoid allocating another buffer and copying into it.
Peter Harris
--
Open Text Connectivity Solutions Group
Peter Harris http://connectivity.opentext.com/
Research and Development Phone: +1 905 762 6001
pharris at opentext.com Toll Free: 1 877 359 4866
More information about the Xcb
mailing list