emacs-devel
[Top][All Lists]
Advanced

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

Re: Compiling Elisp to a native code with a GCC plugin


From: David Kastrup
Subject: Re: Compiling Elisp to a native code with a GCC plugin
Date: Fri, 17 Sep 2010 15:55:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Lars Magne Ingebrigtsen <address@hidden> writes:

> David Kastrup <address@hidden> writes:
>
>> +   end_byte = CHAR_TO_BYTE (end);
>> + 
>> +   if (! memcmp (SDATA (string), BYTE_POS_ADDR (start_byte),
>> +            end_byte - start_byte))
>>
>> That is assuming that both string and buffer are identically encoded
>> (nowadays that likely means both have the same multibyteness).
>
> Which brings me back to the other question I had, about buffer
> internals.  :-)
>
> It was a guess based on Fbuffer_substring doing this:
>
>   memcpy (SDATA (result), BYTE_POS_ADDR (start_byte), end_byte - start_byte);
>
> So I thought that if you could create a string by just memcpy()-ing data
> from the buffer, then it seemed likely that you could compare them with
> memcmp().  But that's probably wrong?

Fbuffer_substring also likely copies the multibyteness, not just the
bytes.

-- 
David Kastrup




reply via email to

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