[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 15/16] Remove local_flags array in struct buffer
From: |
Eli Zaretskii |
Subject: |
Re: [PATCH v2 15/16] Remove local_flags array in struct buffer |
Date: |
Tue, 01 Dec 2020 19:57:17 +0200 |
> From: Spencer Baugh <sbaugh@catern.com>
> Date: Sat, 21 Nov 2020 21:34:44 -0500
> Cc: Spencer Baugh <sbaugh@catern.com>, Arnold Noronha <arnold@tdrhq.com>,
> Stefan Monnier <monnier@iro.umontreal.ca>, Dmitry Gutov <dgutov@yandex.ru>
>
> +#define BVAR_DIRECT(buf, field) ((buf)->field ## _)
I think I'd prefer to call this BVAL instead. Or maybe leave this
BVAR and rename the getter to something else.
> @@ -963,8 +958,6 @@ reset_buffer (register struct buffer *b)
> bset_display_count (b, make_fixnum (0));
> bset_display_time (b, Qnil);
> bset_enable_multibyte_characters (b, Qt);
> - bset_cursor_type (b, BVAR (&buffer_defaults, cursor_type));
> - bset_extra_line_spacing (b, BVAR (&buffer_defaults, extra_line_spacing));
Why are we removing these two?
> @@ -1238,7 +1231,7 @@ buffer_local_value (Lisp_Object variable, Lisp_Object
> buffer)
> {
> lispfwd fwd = SYMBOL_FWD (sym);
> if (BUFFER_OBJFWDP (fwd))
> - result = per_buffer_value (buf, XBUFFER_OBJFWD (fwd)->offset);
> + result = bvar_get (buf, XBUFFER_OBJFWD (fwd)->offset);
Indentation whitespace changes again.
> +INLINE Lisp_Object
> +bvar_get (struct buffer *b, ptrdiff_t offset)
> +{
> + Lisp_Object val = per_buffer_value (b, offset);
> + return EQ (val, Qunbound)
> + ? per_buffer_default (offset)
> + : val;
> }
Ouch! an inline function that calls another inline function, instead
of a simple pointer dereference. Now I'm _really_ worried about the
effect on performance.
Can we make this faster, especially in unoptimized builds?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v2 15/16] Remove local_flags array in struct buffer,
Eli Zaretskii <=