aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-09-06 13:15:44 +0400
committerDmitry Antipov2012-09-06 13:15:44 +0400
commitc752cfa916879f7415990855b52862dd585242ec (patch)
tree01e45e518004fb11b795072e060b2336847080dc /src/buffer.c
parent826b32357739a0ce755a5a2cadb3552b6914f4b3 (diff)
downloademacs-c752cfa916879f7415990855b52862dd585242ec.tar.gz
emacs-c752cfa916879f7415990855b52862dd585242ec.zip
Explicitly mark buffer_defaults and buffer_local_symbols.
* alloc.c (Fgarbage_collect): Mark buffer_defaults and mark_local_symbols here. (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking since special buffers aren't marked here any more. (allocate_buffer): Chain new buffer with all_buffers here... * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and not here. (Vbuffer_defaults, Vbuffer_local_symbols): Remove. (syms_of_buffer): Remove staticpro of the above. (init_buffer_once): Set names for buffer_defaults and buffer_local_symbols.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 7698b72a3c6..187277d663b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -60,10 +60,6 @@ struct buffer *all_buffers;
60 60
61struct buffer alignas (GCALIGNMENT) buffer_defaults; 61struct buffer alignas (GCALIGNMENT) buffer_defaults;
62 62
63/* A Lisp_Object pointer to the above, used for staticpro */
64
65static Lisp_Object Vbuffer_defaults;
66
67/* This structure marks which slots in a buffer have corresponding 63/* This structure marks which slots in a buffer have corresponding
68 default values in buffer_defaults. 64 default values in buffer_defaults.
69 Each such slot has a nonzero value in this structure. 65 Each such slot has a nonzero value in this structure.
@@ -87,9 +83,6 @@ struct buffer buffer_local_flags;
87 83
88struct buffer alignas (GCALIGNMENT) buffer_local_symbols; 84struct buffer alignas (GCALIGNMENT) buffer_local_symbols;
89 85
90/* A Lisp_Object pointer to the above, used for staticpro */
91static Lisp_Object Vbuffer_local_symbols;
92
93/* Return the symbol of the per-buffer variable at offset OFFSET in 86/* Return the symbol of the per-buffer variable at offset OFFSET in
94 the buffer structure. */ 87 the buffer structure. */
95 88
@@ -595,10 +588,6 @@ even if it is dead. The return value is never nil. */)
595 bset_width_table (b, Qnil); 588 bset_width_table (b, Qnil);
596 b->prevent_redisplay_optimizations_p = 1; 589 b->prevent_redisplay_optimizations_p = 1;
597 590
598 /* Put this on the chain of all buffers including killed ones. */
599 b->header.next.buffer = all_buffers;
600 all_buffers = b;
601
602 /* An ordinary buffer normally doesn't need markers 591 /* An ordinary buffer normally doesn't need markers
603 to handle BEGV and ZV. */ 592 to handle BEGV and ZV. */
604 bset_pt_marker (b, Qnil); 593 bset_pt_marker (b, Qnil);
@@ -819,10 +808,6 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
819 b->width_run_cache = 0; 808 b->width_run_cache = 0;
820 bset_width_table (b, Qnil); 809 bset_width_table (b, Qnil);
821 810
822 /* Put this on the chain of all buffers including killed ones. */
823 b->header.next.buffer = all_buffers;
824 all_buffers = b;
825
826 name = Fcopy_sequence (name); 811 name = Fcopy_sequence (name);
827 set_string_intervals (name, NULL); 812 set_string_intervals (name, NULL);
828 bset_name (b, name); 813 bset_name (b, name);
@@ -5145,10 +5130,11 @@ init_buffer_once (void)
5145 buffer_local_symbols.indirections = 0; 5130 buffer_local_symbols.indirections = 0;
5146 set_buffer_intervals (&buffer_defaults, NULL); 5131 set_buffer_intervals (&buffer_defaults, NULL);
5147 set_buffer_intervals (&buffer_local_symbols, NULL); 5132 set_buffer_intervals (&buffer_local_symbols, NULL);
5133 /* This is not strictly necessary, but let's make them initialized. */
5134 bset_name (&buffer_defaults, build_pure_c_string (" *buffer-defaults*"));
5135 bset_name (&buffer_local_symbols, build_pure_c_string (" *buffer-local-symbols*"));
5148 XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); 5136 XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize);
5149 XSETBUFFER (Vbuffer_defaults, &buffer_defaults);
5150 XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize); 5137 XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize);
5151 XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols);
5152 5138
5153 /* Set up the default values of various buffer slots. */ 5139 /* Set up the default values of various buffer slots. */
5154 /* Must do these before making the first buffer! */ 5140 /* Must do these before making the first buffer! */
@@ -5430,8 +5416,6 @@ syms_of_buffer (void)
5430 last_overlay_modification_hooks 5416 last_overlay_modification_hooks
5431 = Fmake_vector (make_number (10), Qnil); 5417 = Fmake_vector (make_number (10), Qnil);
5432 5418
5433 staticpro (&Vbuffer_defaults);
5434 staticpro (&Vbuffer_local_symbols);
5435 staticpro (&Qfundamental_mode); 5419 staticpro (&Qfundamental_mode);
5436 staticpro (&Qmode_class); 5420 staticpro (&Qmode_class);
5437 staticpro (&QSFundamental); 5421 staticpro (&QSFundamental);