* Outdated comment in eval.c?
[not found] <87h7ee3b7d.fsf.ref@yahoo.com>
@ 2021-09-21 2:37 ` Po Lu
2021-09-21 6:18 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Po Lu @ 2021-09-21 2:37 UTC (permalink / raw)
To: emacs-devel
At line 367 of eval.c, I see the following comment:
/* NOTE!!! Every function that can call EVAL must protect its args
and temporaries from garbage collection while it needs them.
The definition of `For' shows what you have to do. */
But GCPRO has been gone for a long time, as Emacs now exclusively use
conservative stack marking.
Would it be prudent to remove this comment?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Outdated comment in eval.c?
2021-09-21 2:37 ` Outdated comment in eval.c? Po Lu
@ 2021-09-21 6:18 ` Eli Zaretskii
2021-09-22 7:09 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2021-09-21 6:18 UTC (permalink / raw)
To: Po Lu; +Cc: emacs-devel
> From: Po Lu <luangruo@yahoo.com>
> Date: Tue, 21 Sep 2021 10:37:58 +0800
>
> At line 367 of eval.c, I see the following comment:
>
> /* NOTE!!! Every function that can call EVAL must protect its args
> and temporaries from garbage collection while it needs them.
> The definition of `For' shows what you have to do. */
>
> But GCPRO has been gone for a long time, as Emacs now exclusively use
> conservative stack marking.
>
> Would it be prudent to remove this comment?
The issue is still valid, although it's now more subtle, and 'For' is
no longer a useful reference. GC can relocate buffers text and string
data, so the issue nowadays is to be careful with C 'char *' pointers
to buffer text and string data, and recompute them after every call to
a function that might trigger a GC.
I will see how to reword the comment, and will probably move it to
another place, where it is more pertinent.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Outdated comment in eval.c?
2021-09-21 6:18 ` Eli Zaretskii
@ 2021-09-22 7:09 ` Eli Zaretskii
0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2021-09-22 7:09 UTC (permalink / raw)
To: luangruo; +Cc: emacs-devel
> Date: Tue, 21 Sep 2021 09:18:27 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
>
> The issue is still valid, although it's now more subtle, and 'For' is
> no longer a useful reference. GC can relocate buffers text and string
> data, so the issue nowadays is to be careful with C 'char *' pointers
> to buffer text and string data, and recompute them after every call to
> a function that might trigger a GC.
>
> I will see how to reword the comment, and will probably move it to
> another place, where it is more pertinent.
Now done.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-22 7:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <87h7ee3b7d.fsf.ref@yahoo.com>
2021-09-21 2:37 ` Outdated comment in eval.c? Po Lu
2021-09-21 6:18 ` Eli Zaretskii
2021-09-22 7:09 ` Eli Zaretskii
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.