emacs-devel
[Top][All Lists]
Advanced

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

Re: Edebug corrupting point in buffers; we need buffer-point and set-buf


From: Stefan Monnier
Subject: Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps.
Date: Mon, 31 Oct 2022 16:35:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

>> >> +  CHECK_FIXNUM_COERCE_MARKER (pos);
>> >> +  p = XFIXNUM (pos);
>> >
>> > This is sub-optimal: a marker holds both character and byte position,
>> > and you lose it here.  Ignoring the byte position is only justified if
>> > the marker belongs to the wrong buffer.
>> I suspect the performance impact is negligible
> Are you talking about using character and byte position,

Yes, tho only specifically in this `set-buffer-point` case.

> The performance impact of char_to_byte is not negligible at all!

Agreed.  My comment was based on the fact that I don't expect
`set-buffer-point` to be called very many times.

> My remarks were general, not necessarily related to this particular
> patch.  The principle should always be if you already have a byte
> position, use it!

I didn't mean to imply otherwise.


        Stefan




reply via email to

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