[Top][All Lists]

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

Re: [patch] cache color info for remote X sessions [Was: Emacs 21/X11 ge

From: Ami Fischman
Subject: Re: [patch] cache color info for remote X sessions [Was: Emacs 21/X11 generating unbelieveable network traffic]
Date: Mon, 07 Oct 2002 09:49:34 -0700
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2.50 (i686-pc-linux-gnu)

"Stefan Monnier" <monnier+gnu/address@hidden> writes:


> As someone whose colormap is full about 95% of the time, I can
> assure you that tose things happen ;-)

Really?  I guess I've been spoiled by my video card (which is a not very
respectable 4M matrox) and more respectable lack of use of colors :)

The shame of not caching the XFreeColors has caught up with me, so I added
a refcount and a wrapper for XFreeColors that takes advantage of the
refcount (so the X server only sees the Free request once per cached color,
and upon final Free'ing, the cache entry is removed).  This ensures there
are no stale entries in the cache.  The performance hit is negligible in my

The newest versions of xcache.[ch] reflect:
- Reformatted function calls to K&R style
- Added a lot of comments to explain what's going on
- Added refcounting & XFreeColors caching

Note that in order to take advantage of the XFreeColors caching, you need
to add the xcache.h header to other files.  Included is also a patch that
does that.

  Ami Fischman

Attachment: add-xcache.patch
Description: Text Data

Attachment: xcache.h
Description: Text document

Attachment: xcache.c
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]