emacs-devel
[Top][All Lists]
Advanced

[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: Miles Bader
Subject: Re: [patch] cache color info for remote X sessions [Was: Emacs 21/X11 generating unbelieveable network traffic]
Date: Sat, 5 Oct 2002 21:29:32 -0400
User-agent: Mutt/1.3.28i

On Sat, Oct 05, 2002 at 05:21:48PM -0700, Ami Fischman wrote:
> This new functionality is provided via two new files (xcache.[ch]), adding
> xcache.o to the XOBJ variable in src/Makefile, adding -DUSE_XCACHE to the
> ALL_CFLAGS in the Makefile, and the following small patch to xterm.c:

I like the approach of having a general `X cache' and wrapping individual
functions -- it may not be the best thing in all cases, but it seems very
simple to add/maintain (and if necessary revert).

There are some problems with your implementation though --

  The C code doesn't following GNU coding standards (and is a bit hard to read)

  It seems to have unnecessary overhead, even in the `cached' case -- it does
  malloc and memory copying for _every_ call, which seems silly just to pass
  to a compare function.  Something that supported multiple keys in the cache
  entries, so that the wrapper functions could just directly pass their
  arguments to the cache lookup function, seems preferable.

  It's going to leak memory like crazy, since the above-mentioned mallocs
  don't ever appear to be freed...

BTW, I thought someone experimented with caching calls to X color functions
before (Kim?) and for some reason that code was never merged, so perhaps
there's a deeper problem with doing this.

-Miles
-- 
Suburbia: where they tear out the trees and then name streets after them.




reply via email to

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