[cairo] Keep a small stash of cairo contexts

Carl Worth cworth at cworth.org
Mon Jun 15 15:02:47 PDT 2009


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.

-Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.cairographics.org/archives/cairo/attachments/20090615/ad88e3fa/attachment.pgp 


More information about the cairo mailing list