[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A patch for large string support
From: |
Neil Jerram |
Subject: |
Re: A patch for large string support |
Date: |
Mon, 13 Nov 2006 21:50:39 +0000 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Daniel Ridge <address@hidden> writes:
> Hello,
>
> Apologies in advance if this is a topic that has already been
> addressed in Guile in some other way.
>
> I use large strings in Guile and frequently bump into the 24 bit
> string size limit in guile 1.6.x.
>
> I patch my Guiles with the attached small patch for large strings and
> wondered if there was any general interest in this type of thing. I
> started using this approach under 1.6.4 and have recently updated the
> patch to 1.6.8
>
> I make no warranties about the correctness of this approach.
Thanks. I see no harm in applying this, on the basis that it's
provably safe (subject to comments following) and makes your life a
little easier in future 1.6.x releases. It would not be appropriate
for us to consider making big strings the default in 1.6.x though - do
you agree?
In 1.8.x and HEAD, as you're probably aware, strings are already
double cells.
> +#ifdef SMALLSTRINGS
I propose to change this throughout to #ifndef GUILE_EXPERIMENTAL_BIG_STRINGS.
> @@ -55,9 +55,17 @@
> #define SCM_STRING_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x)))
> #endif
> #define SCM_SET_STRING_CHARS(s, c) (SCM_SET_CELL_WORD_1 ((s), (c)))
> +#ifdef SMALLSTRINGS
> #define SCM_STRING_MAX_LENGTH ((1UL << 24) - 1UL)
> #define SCM_STRING_LENGTH(x) ((size_t) (SCM_CELL_WORD_0 (x) >> 8))
> #define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), (((long) (l))
> << 8) + scm_tc7_string))
> +#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), (((long) (l))
> << 8) + scm_tc7_substring))
I believe this should be SCM_SET_SUBSTRING_LENGTH.
Is that all OK?
Regards,
Neil