[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Outdated comment in eval.c?
From: |
Eli Zaretskii |
Subject: |
Re: Outdated comment in eval.c? |
Date: |
Tue, 21 Sep 2021 09:18:27 +0300 |
> 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.