* EVENT_INIT and obs. kbd_buffer_gcpro: 'arg' init still needed?
@ 2006-05-31 13:50 Adrian Robert
2006-06-01 9:56 ` YAMAMOTO Mitsuharu
0 siblings, 1 reply; 3+ messages in thread
From: Adrian Robert @ 2006-05-31 13:50 UTC (permalink / raw)
Hi,
One use of the termhooks.h EVENT_INIT() macro in macterm.c also takes
care to init the event's 'arg' to "Qnil", explaining with this comment:
/* It is necessary to set this (additional) argument slot of an
event to nil because keyboard.c protects incompletely
processed event from being garbage collected by placing them
in the kbd_buffer_gcpro vector. */
However, according to the ChangeLog this vector was removed on
2004-01-21 in response to changes on 2003-06-15, including the very
introduction of the EVENT_INIT() macro. My question is, is the
additional call to set 'arg' to "Qnil", found in w32, mac, and x
terms, still needed? I notice that macterm does not have it for
other calls to EVENT_INIT. Other terms only use EVENT_INIT once.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: EVENT_INIT and obs. kbd_buffer_gcpro: 'arg' init still needed?
2006-05-31 13:50 EVENT_INIT and obs. kbd_buffer_gcpro: 'arg' init still needed? Adrian Robert
@ 2006-06-01 9:56 ` YAMAMOTO Mitsuharu
2006-06-01 13:16 ` Adrian Robert
0 siblings, 1 reply; 3+ messages in thread
From: YAMAMOTO Mitsuharu @ 2006-06-01 9:56 UTC (permalink / raw)
Cc: emacs-devel
>>>>> On Wed, 31 May 2006 09:50:35 -0400, Adrian Robert <arobert@cogsci.ucsd.edu> said:
> One use of the termhooks.h EVENT_INIT() macro in macterm.c also takes
> care to init the event's 'arg' to "Qnil", explaining with this comment:
> /* It is necessary to set this (additional) argument slot of an
> event to nil because keyboard.c protects incompletely
> processed event from being garbage collected by placing them
> in the kbd_buffer_gcpro vector. */
> However, according to the ChangeLog this vector was removed on
> 2004-01-21 in response to changes on 2003-06-15, including the very
> introduction of the EVENT_INIT() macro.
I removed this comment that is referring to a nonexistent variable
from macterm.c.
> My question is, is the additional call to set 'arg' to "Qnil", found
> in w32, mac, and x terms, still needed? I notice that macterm does
> not have it for other calls to EVENT_INIT. Other terms only use
> EVENT_INIT once.
Although bzero'ed Lisp_Object corresponds to integer 0 and thus it
does not leads to a real problem, I think we should not rely on this.
So I added some code to set `arg' to Qnil in macterm.c.
YAMAMOTO Mitsuharu
mituharu@math.s.chiba-u.ac.jp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: EVENT_INIT and obs. kbd_buffer_gcpro: 'arg' init still needed?
2006-06-01 9:56 ` YAMAMOTO Mitsuharu
@ 2006-06-01 13:16 ` Adrian Robert
0 siblings, 0 replies; 3+ messages in thread
From: Adrian Robert @ 2006-06-01 13:16 UTC (permalink / raw)
On Jun 1, 2006, at 5:56 AM, YAMAMOTO Mitsuharu wrote:
>>>>>> On Wed, 31 May 2006 09:50:35 -0400, Adrian Robert
>>>>>> <arobert@cogsci.ucsd.edu> said:
>
>> One use of the termhooks.h EVENT_INIT() macro in macterm.c also takes
>> care to init the event's 'arg' to "Qnil", explaining with this
>> comment:
>
>> /* It is necessary to set this (additional) argument slot
>> of an
>> event to nil because keyboard.c protects incompletely
>> processed event from being garbage collected by placing them
>> in the kbd_buffer_gcpro vector. */
>
>> However, according to the ChangeLog this vector was removed on
>> 2004-01-21 in response to changes on 2003-06-15, including the very
>> introduction of the EVENT_INIT() macro.
>
> I removed this comment that is referring to a nonexistent variable
> from macterm.c.
>
>> My question is, is the additional call to set 'arg' to "Qnil", found
>> in w32, mac, and x terms, still needed? I notice that macterm does
>> not have it for other calls to EVENT_INIT. Other terms only use
>> EVENT_INIT once.
>
> Although bzero'ed Lisp_Object corresponds to integer 0 and thus it
> does not leads to a real problem, I think we should not rely on this.
> So I added some code to set `arg' to Qnil in macterm.c.
So a non-nil 'arg' CAN lead to errors?
Then is there any reason not to do the Qnil init in the EVENT_INIT
macro? All places using it have lisp.h.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-06-01 13:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-31 13:50 EVENT_INIT and obs. kbd_buffer_gcpro: 'arg' init still needed? Adrian Robert
2006-06-01 9:56 ` YAMAMOTO Mitsuharu
2006-06-01 13:16 ` Adrian Robert
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.