diff options
author | Ludovic Courtès <ludo@gnu.org> | 2011-03-20 23:34:42 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2011-03-20 23:34:42 +0100 |
commit | 190d4b0d93599e5b58e773dc6375054c3a6e3dbf (patch) | |
tree | 3feaf151da16529141472853968c14f570b5955a /libguile/strings.h | |
parent | 95c1cfb550e2e753324c5cc57ef5df90034f072a (diff) | |
download | guile-190d4b0d93599e5b58e773dc6375054c3a6e3dbf.tar.gz |
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.
Diffstat (limited to 'libguile/strings.h')
-rw-r--r-- | libguile/strings.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libguile/strings.h b/libguile/strings.h index ed3a067c2..b1fc51a38 100644 --- a/libguile/strings.h +++ b/libguile/strings.h @@ -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); |