GNU bug report logs - #56347
Optimize/simplify STRING_SET_MULTIBYTE

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Fri, 1 Jul 2022 23:33:01 UTC

Severity: wishlist

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 56347 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 56347 <at> debbugs.gnu.org
Subject: Re: bug#56347: Optimize/simplify STRING_SET_MULTIBYTE
Date: Sat, 02 Jul 2022 21:31:35 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: 56347 <at> debbugs.gnu.org
> Date: Sat, 02 Jul 2022 14:00:41 -0400
> 
> >> No, I want to reduce the scope of semantics of the macro, e.g. so it can
> >> be implemented as a function rather than a macro and so it doesn't
> >> magically substitute empty_multibyte_string into a variable that held
> >> something else.
> > But the effect is that you disallow calling STRING_SET_MULTIBYTE on an
> > empty string, isn't it?
> 
> Yes.  In my book, STRING_SET_*IBYTE should basically not exist: a string
> is created as unibyte or multibyte and never changes after that.

That's require a much larger change, I think.  It is not enough just
to add an assertion in one place, because that'd just cause
maintenance headaches for no real gain.

And I'm not even sure everyone will agree with such a radical change.
It should be discussed first.

> And indeed because we only have a single copy of the two possible empty
> strings, they can't be changed between unibyte<->multibyte

I can create an empty string without those singletons any time.




This bug report was last modified 3 years and 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.