[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory management



Keith Lucas wrote:

> >This is simple optimization. Z-order, in the purest sense, is a list,
> >from nearest to fartest. But raising a window would mean updating many
> >pointers, moving the end of the list at the top, grafting what was the
> >top at the end (meaning finding the end, which means walking the list
> >for a simple singly linked list) and finally updating the pointer to the
> >list in the parent window.
> 
> Premature optimisation...etc.

It is not really about time saved *running* the thing. I just found that
"child = child->next;" as my window raising code was simpler than
playing around with lists.

And there is a way out of this one for refcounting, soft and hard
references.

-- 
Pierre Phaneuf
Ludus Design, http://ludusdesign.com/
"First they ignore you. Then they laugh at you.
Then they fight you. Then you win." -- Gandhi