* Q about staticvec declaration
@ 2024-03-27 9:38 Gerd Möllmann
2024-03-27 11:44 ` Mattias Engdegård
0 siblings, 1 reply; 5+ messages in thread
From: Gerd Möllmann @ 2024-03-27 9:38 UTC (permalink / raw)
To: emacs-devel
Can someone please explain why staticvec is declared as
Lisp_Object const *staticvec[NSTATICS]
which is the same as
const Lisp_Object *staticvec[NSTATICS]
?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Q about staticvec declaration
2024-03-27 9:38 Q about staticvec declaration Gerd Möllmann
@ 2024-03-27 11:44 ` Mattias Engdegård
2024-03-27 12:15 ` Gerd Möllmann
0 siblings, 1 reply; 5+ messages in thread
From: Mattias Engdegård @ 2024-03-27 11:44 UTC (permalink / raw)
To: Gerd Möllmann; +Cc: emacs-devel
27 mars 2024 kl. 10.38 skrev Gerd Möllmann <gerd.moellmann@gmail.com>:
> Can someone please explain why staticvec is declared as
>
> Lisp_Object const *staticvec[NSTATICS]
>
> which is the same as
>
> const Lisp_Object *staticvec[NSTATICS]
That's just a matter of individual handwriting, there's nothing more to it.
I think we can tolerate either.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Q about staticvec declaration
2024-03-27 11:44 ` Mattias Engdegård
@ 2024-03-27 12:15 ` Gerd Möllmann
2024-03-27 12:54 ` Mattias Engdegård
0 siblings, 1 reply; 5+ messages in thread
From: Gerd Möllmann @ 2024-03-27 12:15 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: emacs-devel
On 27.03.24 12:44, Mattias Engdegård wrote:
> 27 mars 2024 kl. 10.38 skrev Gerd Möllmann <gerd.moellmann@gmail.com>:
>
>> Can someone please explain why staticvec is declared as
>>
>> Lisp_Object const *staticvec[NSTATICS]
>>
>> which is the same as
>>
>> const Lisp_Object *staticvec[NSTATICS]
>
> That's just a matter of individual handwriting, there's nothing more to it.
> I think we can tolerate either.
>
You mean the "type const" vs. "const type"? I agree that doesn't matter
much.
What I meant to ask is why are the Lisp_Objects considered const when
viewed through staticvec. I mentioned the other form in case it weren't
clear that both are the same. I mean, the staticpro'd variables are
clearly non-const.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Q about staticvec declaration
2024-03-27 12:15 ` Gerd Möllmann
@ 2024-03-27 12:54 ` Mattias Engdegård
2024-03-27 13:03 ` Gerd Möllmann
0 siblings, 1 reply; 5+ messages in thread
From: Mattias Engdegård @ 2024-03-27 12:54 UTC (permalink / raw)
To: Gerd Möllmann; +Cc: emacs-devel
27 mars 2024 kl. 13.15 skrev Gerd Möllmann <gerd.moellmann@gmail.com>:
> What I meant to ask is why are the Lisp_Objects considered const when viewed through staticvec.
Oh, I see. No idea, but it's not obvious that all static roots are free game for a moving GC (for example, there could be other references that expect the static roots to remain unchanged for all I know).
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Q about staticvec declaration
2024-03-27 12:54 ` Mattias Engdegård
@ 2024-03-27 13:03 ` Gerd Möllmann
0 siblings, 0 replies; 5+ messages in thread
From: Gerd Möllmann @ 2024-03-27 13:03 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: emacs-devel
On 27.03.24 13:54, Mattias Engdegård wrote:
> 27 mars 2024 kl. 13.15 skrev Gerd Möllmann
> <gerd.moellmann@gmail.com>:
>
>> What I meant to ask is why are the Lisp_Objects considered const
>> when viewed through staticvec.
>
> Oh, I see. No idea, but it's not obvious that all static roots are
> free game for a moving GC (for example, there could be other
> references that expect the static roots to remain unchanged for all I
> know).
Yes, that's what I'm trying to understand, if there is something that
depends on that. Without success, so far.
But it could also be a mistake, of course. Something like "const *"
where "* const" was meant. Who knows...
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-03-27 13:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 9:38 Q about staticvec declaration Gerd Möllmann
2024-03-27 11:44 ` Mattias Engdegård
2024-03-27 12:15 ` Gerd Möllmann
2024-03-27 12:54 ` Mattias Engdegård
2024-03-27 13:03 ` Gerd Möllmann
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.