diff options
author | Andy Wingo <wingo@pobox.com> | 2017-02-16 12:57:46 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2017-02-16 13:11:29 +0100 |
commit | d0934df1f2f0e5d3fa9a1a1f15e6f2dec1d15698 (patch) | |
tree | 4f15abdb93948be9df6510b8dd9cb658a56fb3ae /libguile/cache-internal.h | |
parent | c38b9625c88f4d1760068926273b6d89ffbd4527 (diff) | |
download | guile-d0934df1f2f0e5d3fa9a1a1f15e6f2dec1d15698.tar.gz |
Stringbufs immutable by default
* libguile/snarf.h (SCM_IMMUTABLE_STRINGBUF): Remove shared flag.
Stringbufs are immutable by default.
* libguile/strings.c: Rewrite blurb. Change to have stringbufs be
immutable by default and mutable only when marked as such. Going
mutable means making a private copy.
(STRINGBUF_MUTABLE, STRINGBUF_F_MUTABLE): New definitions.
(SET_STRINGBUF_SHARED): Remove.
(scm_i_print_stringbuf): Simplify to just alias the stringbuf as-is.
(substring_with_immutable_stringbuf): New helper.
(scm_i_substring, scm_i_substring_read_only, scm_i_substring_copy):
use new helper.
(scm_i_string_ensure_mutable_x): New helper.
(scm_i_substring_shared): Use scm_i_string_ensure_mutable_x.
(stringbuf_write_mutex): Remove; yaaaaaaaay.
(scm_i_string_start_writing): Use scm_i_string_ensure_mutable_x. No
more mutex.
(scm_i_string_stop_writing): Now a no-op.
(scm_i_make_symbol): Use substring/copy.
(scm_sys_string_dump, scm_sys_symbol_dump): Update.
* libguile/strings.h (SCM_I_STRINGBUF_F_SHARED): Remove.
(SCM_I_STRINGBUF_F_MUTABLE): Add.
* module/system/vm/assembler.scm (link-data): Don't add shared flag any
more. Existing compiled flags are harmless tho.
* test-suite/tests/strings.test ("string internals"): Update.
Diffstat (limited to 'libguile/cache-internal.h')
0 files changed, 0 insertions, 0 deletions