[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: |
Eli Zaretskii |
Subject: |
Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps. |
Date: |
Mon, 31 Oct 2022 20:09:08 +0200 |
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Alan Mackenzie <acm@muc.de>, emacs-devel@gnu.org
> Date: Mon, 31 Oct 2022 13:19:34 -0400
>
> >> + 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, or are you
talking about something else? The performance impact of char_to_byte
is not negligible at all!
> compared to what it would
> cost using `set-buffer`. Since we're not convinced the cost of
> `set-buffer` is high enough to justify `set-buffer-point`, I wouldn't
> worry about optimizing the case where the arg is a marker.
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!
- Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Alan Mackenzie, 2022/10/31
- Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Eli Zaretskii, 2022/10/31
- Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Alan Mackenzie, 2022/10/31
- Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Eli Zaretskii, 2022/10/31
- Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Alan Mackenzie, 2022/10/31
- Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Stefan Monnier, 2022/10/31
- Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Eli Zaretskii, 2022/10/31
- Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Alan Mackenzie, 2022/10/31
- Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Stefan Monnier, 2022/10/31
- Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps.,
Eli Zaretskii <=
- Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Stefan Monnier, 2022/10/31
Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Stefan Monnier, 2022/10/31
Re: Edebug corrupting point in buffers; we need buffer-point and set-buffer-point, perhaps., Alan Mackenzie, 2022/10/31