GNU bug report logs -
#56347
Optimize/simplify STRING_SET_MULTIBYTE
Previous Next
Full log
Message #37 received at 56347 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: 56347 <at> debbugs.gnu.org
> Date: Sat, 02 Jul 2022 14:37:18 -0400
>
> >> 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.
>
> `grep STRING_SET_MULTIBYTE` suggests it's not nearly as hard you think.
>
> The only other use is in `aset`.
That's not what I meant. If you want to disallow changing the
representation of strings, STRING_SET_MULTIBYTE is just the tip of the
iceberg.
> >> 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.
>
> My experience is that it takes a fair bit of work to do so.
I don't see how that matters here, sorry.
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.