|
From: | Paul Eggert |
Subject: | Re: Dynamic loading progress |
Date: | Sun, 08 Feb 2015 16:34:32 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
Aurélien Aptel wrote:
I've replaced DEFSYM calls with: MQfoo = intern ("foo") Are there any drawbacks?
It's a bit slower. Symbols like Qabove are compile-time constants; on my platform, for example, Qabove == 8688, and this integer is known at compile-time. This gives C compilers more opportunities for optimization than variables like MQfoo do.
The fact that globals are actually macros exanding to a global struct member is not desirable here as it prevents normal C lexical scoping.
That sounds like it might be more trouble than it's worth. These symbols are globally unique anyway, in Elisp, so it's a bit clearer to keep them globally unique in C as well, rather than attempt to reuse them with C lexical scoping.
[Prev in Thread] | Current Thread | [Next in Thread] |