[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: immediate strings
From: |
Andreas Schwab |
Subject: |
Re: immediate strings |
Date: |
Sat, 26 Nov 2011 08:56:12 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) |
Dmitry Antipov <address@hidden> writes:
> @@ -3901,7 +3913,9 @@
> return (offset >= 0
> && offset % sizeof b->strings[0] == 0
> && offset < (STRING_BLOCK_SIZE * sizeof b->strings[0])
> - && ((struct Lisp_String *) p)->data != NULL);
> + /* Live immediate string always has at least one
> + non-zero byte, so this check will be passed. */
> + && ((struct Lisp_String *) p)->u.ptrdata != NULL);
Does it? What about "\0"?
> @@ -843,14 +848,24 @@
> /* Set text properties. */
> #define STRING_SET_INTERVALS(STR, INT) (XSTRING (STR)->intervals = (INT))
>
> -/* In a string or vector, the sign bit of the `size' is the gc mark bit */
> -
> struct Lisp_String
> {
> - EMACS_INT size;
> - EMACS_INT size_byte;
> - INTERVAL intervals; /* text properties in this string */
> - unsigned char *data;
> + EMACS_INT size : BITS_PER_EMACS_INT - 1;
> + EMACS_INT size_byte : BITS_PER_EMACS_INT - 1;
This means that any access to size or size_byte will have to shift now
(and not just mask) across a word boundary. This may pessimize it quite
a bit.
Andreas.
--
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
- immediate strings, Dmitry Antipov, 2011/11/25
- Re: immediate strings,
Andreas Schwab <=
- Re: immediate strings, Paul Eggert, 2011/11/26
- Re: immediate strings, Eli Zaretskii, 2011/11/26
- Re: immediate strings, Dmitry Antipov, 2011/11/26
- Re: immediate strings, Paul Eggert, 2011/11/26
- --with-wide-int, Stefan Monnier, 2011/11/27
- Re: --with-wide-int, Paul Eggert, 2011/11/28
- Re: --with-wide-int, Stefan Monnier, 2011/11/28
- Re: --with-wide-int, Dan Nicolaescu, 2011/11/28
- Re: --with-wide-int, Eli Zaretskii, 2011/11/28