emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master b7f83ad: Prefer memset to repeatedly assigning


From: Stefan Monnier
Subject: Re: [Emacs-diffs] master b7f83ad: Prefer memset to repeatedly assigning Qnil
Date: Tue, 20 Jan 2015 14:10:08 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> The problem with this approach is that we'll have sections of code that
> exist only to account for an uncommon configuration.

We don't need to keep the code for the "Qnil!=0" case, but we should
limit the reliance on "Qnil==0" to a few specific places where rewriting
it differently is fairly easy difficult.  E.g. a few macros in lisp.h
for example.

> They'll bitrot, and the code will grow implicit dependencies on Qnil
> being zero anyway.

That'll happen any way, indeed, by accident.  Just like we had places
which relied on 0==make_number(0), which we've had to find the hard way
(and there might still be some such places we haven't yet noticed).

But if we only consciously rely on Qnil==0 in a few special places, then
we're less likely to introduce such dependencies by accident all over
the place.

> It'll be just like GCPRO. I'd rather just declare that Qnil will always
> be zero and take full advantage of the change.

Regarding GCPRO, I'd be happy to get rid of them, but AFAIK they're
still used on a few platforms.  If we can fix those remaining platforms
we can get rid of GCPRO.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]