guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: null terminated strings


From: Paul Jarc
Subject: Re: null terminated strings
Date: Fri, 16 Jan 2004 15:36:03 -0500
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux)

Brian S McQueen <address@hidden> wrote:
>   If the scheme string is truly null terminated, this can be greatly
> simplified.

Apparently, whether it is guaranteed to be terminated depends on what
version of Guile you're using.  With 1.6.4, it might not be terminated
(judging by the fact that make-shared-substring exists in that
version).  But regardless of whether the guarantee is there in
general, you can always make it so for a particular string using
SCM_STRING_COERCE_0TERMINATION_X, as I showed before.  Versions of
Guile that guarantee termination can define that macro as a no-op to
support existing code.

FWIW, I think that (preferably copy-on-write) shared substrings are
valuable enough for performance (not to mention backward
compatibility) that Guile should not remove them for the sake of
guaranteeing termination.  With shared substrings, we can still get
termination when we need it with SCM_STRING_COERCE_0TERMINATION_X, but
without shared substrings, we cannot get performance when we need it.


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]