Remove the distinction between inline/outline storage for stringbufs.
* libguile/strings.c (STRINGBUF_HEADER_SIZE, STRINGBUF_HEADER_BYTES):
New macros.
(STRINGBUF_F_INLINE, STRINGBUF_INLINE, STRINGBUF_OUTLINE_CHARS,
STRINGBUF_OUTLINE_LENGTH, STRINGBUF_INLINE_CHARS,
STRINGBUF_INLINE_LENGTH, STRINGBUF_MAX_INLINE_LEN): Remove.
(STRINGBUF_CHARS, STRINGBUF_WIDE_CHARS): Adjust to return a fixed
location.
(STRINGBUF_LENGTH): Get the length from word 1.
(make_stringbuf, make_wide_stringbuf): Adjust to use a contiguous
memory region.
(wide_stringbuf): Renamed from `widen_stringbuf'. Adjust similarly.
Return the new stringbuf. Callers updated.
(narrow_stringbuf): Likewise.
(scm_sys_string_dump, scm_sys_symbol_dump): Remove `stringbuf-inline'
pair.
* test-suite/tests/strings.test ("string internals")["null strings are
inlined", "short Latin-1 encoded strings are inlined", "long Latin-1
encoded strings are not inlined", "short UCS-4 encoded strings are not
inlined", "long UCS-4 encoded strings are not inlined"]: Remove.
* test-suite/tests/symbols.test ("symbol internals")["null symbols are
inlined", "short Latin-1 encoded symbols are inlined", "long Latin-1
encoded symbols are not inlined", "short UCS-4 encoded symbols are not
inlined", "long UCS-4 encoded symbols are not inlined"]: Remove.
This commit is contained in:
parent
13a9455669
commit
ba54a2026b
3 changed files with 91 additions and 169 deletions
|
|
@ -63,26 +63,6 @@
|
|||
(let ((s (substring/read-only "zyx" 0)))
|
||||
(assq-ref (%string-dump s) 'read-only)))
|
||||
|
||||
(pass-if "null strings are inlined"
|
||||
(let ((s ""))
|
||||
(assq-ref (%string-dump s) 'stringbuf-inline)))
|
||||
|
||||
(pass-if "short Latin-1 encoded strings are inlined"
|
||||
(let ((s "m"))
|
||||
(assq-ref (%string-dump s) 'stringbuf-inline)))
|
||||
|
||||
(pass-if "long Latin-1 encoded strings are not inlined"
|
||||
(let ((s "0123456789012345678901234567890123456789"))
|
||||
(not (assq-ref (%string-dump s) 'stringbuf-inline))))
|
||||
|
||||
(pass-if "short UCS-4 encoded strings are not inlined"
|
||||
(let ((s "\u0100"))
|
||||
(not (assq-ref (%string-dump s) 'stringbuf-inline))))
|
||||
|
||||
(pass-if "long UCS-4 encoded strings are not inlined"
|
||||
(let ((s "\u010012345678901234567890123456789"))
|
||||
(not (assq-ref (%string-dump s) 'stringbuf-inline))))
|
||||
|
||||
(pass-if "new Latin-1 encoded strings are not shared"
|
||||
(let ((s "abc"))
|
||||
(not (assq-ref (%string-dump s) 'stringbuf-shared))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue