mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-23 20:05:32 +02:00
Make VM string literals immutable.
* libguile/strings.c (scm_i_make_string, scm_i_make_wide_string): Add `read_only_p' parameter. All callers updated. * libguile/vm-i-loader.c (load_string, load_wide_string): Push read-only strings. * test-suite/tests/strings.test ("literals"): New test prefix.
This commit is contained in:
parent
95c1cfb550
commit
190d4b0d93
13 changed files with 83 additions and 56 deletions
|
@ -177,8 +177,11 @@ SCM_API SCM scm_makfromstrs (int argc, char **argv);
|
|||
|
||||
/* internal accessor functions. Arguments must be valid. */
|
||||
|
||||
SCM_INTERNAL SCM scm_i_make_string (size_t len, char **datap);
|
||||
SCM_INTERNAL SCM scm_i_make_wide_string (size_t len, scm_t_wchar **datap);
|
||||
SCM_INTERNAL SCM scm_i_make_string (size_t len, char **datap,
|
||||
int read_only_p);
|
||||
SCM_INTERNAL SCM scm_i_make_wide_string (size_t len, scm_t_wchar **datap,
|
||||
int read_only_p);
|
||||
SCM_INTERNAL SCM scm_i_set_string_read_only_x (SCM str);
|
||||
SCM_INTERNAL SCM scm_i_substring (SCM str, size_t start, size_t end);
|
||||
SCM_INTERNAL SCM scm_i_substring_read_only (SCM str, size_t start, size_t end);
|
||||
SCM_INTERNAL SCM scm_i_substring_shared (SCM str, size_t start, size_t end);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue