GNU bug report logs -
#48264
28.0.50; Changing the default for DEFVAR_PER_BUFFER variables takes O(#buffers) time
Previous Next
Full log
Message #143 received at 48264 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Spencer Baugh <sbaugh <at> catern.com>
>> Cc: 48264 <at> debbugs.gnu.org
>> Date: Fri, 07 May 2021 10:15:14 -0400
>>
>> >> The syntax_table and category_table fields in buffer_defaults are used
>> >> through Vstandard_syntax_table and Vstandard_category_table (which are
>> >> just aliases to the fields in buffer_defaults); the initialization for
>> >> syntax.c and category.c runs before buffer.c, so they're already set at
>> >> this point. I could reorder the initialization if you'd prefer that?
>> >> Or move the initialization into buffer.c?
>> >
>> > If it works to move init_buffer_once before init_syntax_once, I think
>> > that'd be much better.
>>
>> Hm, regrettably, it doesn't seem to be as simple as that; doing so
>> causes failures in dumping. I now remember that I tried this before and
>> had much difficulty doing this by reordering the intialization.
>>
>> I could try moving the initialization into buffer.c?
>
> Maybe making the Vstandard_syntax_table setup a separate function in
> syntax.c, and then calling it from init_buffer_once? IOW, leave only
> the creation of Vstandard_syntax_table in init_syntax_once, and doing
> the rest in init_buffer_once? Does that work?
OK, in the end I was able to get moving init_{syntax,category}_once
after init_buffer_once to work, by initializing the two variables to
Qnil in buffer.c. I assume it wasn't working before because they were
Qunbound rather than Qnil, and something is checking NILP to see if the
variables are initialized. (Although not sure what).
So, I was able to remove the special case.
This bug report was last modified 2 years and 290 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.