GNU bug report logs - #15880
Compute C declarations for DEFSYMs automatically.

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Wed, 13 Nov 2013 00:35:02 UTC

Severity: wishlist

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 15880 <at> debbugs.gnu.org
Subject: bug#15880: Compute C declarations for DEFSYMs automatically.
Date: Wed, 13 Nov 2013 21:29:09 -0500
> Hmm, well, I suppose you're right.  Still, the idea of removing the
> dependency on DEFSYM-related globals would preclude the potential
> optimization of putting these globals into a table at compile-time.

Actually, I'm not sure I understand what you're suggesting here as
a table, and what the optimization could be.  Are you thinking of
something like:

  struct Lisp_Symbol symbol_structs[N];
  const Lisp_Object symbol_vals[N]
    = {
      Lisp_Symbol + (EMACS_INT)(symbol_structs + 0),
      Lisp_Symbol + (EMACS_INT)(symbol_structs + 1),
      ...
    }
  #define Qfoo (symbol_vals[0])
  #define Qbar (symbol_vals[1])
  ...

but if so, would that really be faster?  I mean, can the C compiler
really presume that symbol_vals[0] won't be changed and constant-fold
its value at link-time?

> I suppose that part of the issue is that I don't add or remove
> DEFSYMs very often, so even aside from the precluded optimization
> I'm reluctant to complicate the build system just to save a few
> build-time cycles on these rare occasions.

You might be right (tho my computers tend to be slowish and make such
recompilation very noticeable).

>> such that make-docfile finds the "INTERN", infers the Lisp name from the
>> C name and writes a "syms.c" file which does little else but initialize
>> all those symbols.
> I was thinking of something even simpler: no macros at all.

Sounds good, indeed.


        Stefan




This bug report was last modified 10 years and 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.