[cairo] Keep a small stash of cairo contexts
Chris Wilson
chris at chris-wilson.co.uk
Mon Jun 15 15:11:43 PDT 2009
On Mon, 2009-06-15 at 15:02 -0700, Carl Worth wrote:
> On Sun, 2009-06-07 at 11:53 -0700, Chris Wilson wrote:
> > +static void
> > +_context_put (cairo_t *cr)
> > +{
> > + int old, new, avail;
> > +
> > + if (cr < &_context_stash.pool[0] ||
> > + cr >= &_context_stash.pool[CAIRO_STASH_SIZE])
> > + {
> > + return free (cr);
> > + }
> > +
>
> If I'm not mistaken, we've had reports in the past of compilers that
> don't like to see an explicit "return something();" in a void function
> (evn if something is void itself).
>
> Though I really like the look of the above, and had committed many such
> instances myself, I did end up changing several of them.
No you're absolutely right, we have had such reports and I've had to
alter code occasionally based on those reports as well. I hadn't even
noticed that I had written it that way. Whoops. :-(
-ickle
More information about the cairo
mailing list