[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Improved string writing
From: |
Marius Vollmer |
Subject: |
Re: [PATCH] Improved string writing |
Date: |
Thu, 09 Jun 2005 20:50:30 +0300 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
address@hidden (Ludovic Courtès) writes:
> Marius Vollmer <address@hidden> writes:
>
>> Here is a patch for what I have in mind. I have applied it already.
>
> Just a note: it seems that the line
>
>> + data = scm_i_string_chars (exp);
>
> appears twice within the loop but is not needed.
This is actually needed with the new string representation. See
strings.h:
Internal, low level interface to the character arrays
- Use scm_i_string_chars to get a pointer to the byte array of a
string for reading. Use scm_i_string_length to get the number of
bytes in that array. The array is not null-terminated.
- The array is valid as long as the corresponding SCM object is
protected but only until the next SCM_TICK. During such a 'safe
point', strings might change their representation.
The call to scm_lfwrite might do anything since the port might be a
softport, for example. Thus, we need to call scm_i_string_chars again
after each such call.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405