aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
authorStefan Monnier2020-03-31 19:45:22 -0400
committerStefan Monnier2020-03-31 19:45:45 -0400
commitcddf85d256dda8db1fad50e8e766fd7694361b8f (patch)
treed6cd89343e879eedf1ca46be759b53388f529096 /src/buffer.h
parenta477a7b86ba7c59a90b18283cc86769c27de6c7c (diff)
downloademacs-cddf85d256dda8db1fad50e8e766fd7694361b8f.tar.gz
emacs-cddf85d256dda8db1fad50e8e766fd7694361b8f.zip
Remove `all_buffers` and the associated `next` field of buffers
* src/alloc.c (enum mem_type): Remove MEM_TYPE_BUFFER. (allocate_buffer): Allocate like any other pseudovector. Don't register on `all_buffers` any more. (live_buffer_holding, live_buffer_p): Delete functions. (mark_maybe_object, valid_lisp_object_p): Don't pay attention to MEM_TYPE_BUFFER any more. (garbage_collect): Only compact the live buffers. (mark_buffer): Mark the undo_list of dead buffers here. (mark_object): Buffers are normal pseudovectors now. (sweep_buffers): Don't do the actual sweep here, just cleanup the markers and only for live buffers. * src/buffer.c (all_buffers): Remove variable. (Fkill_buffer): Don't check indirect dead buffers. Set the undo_list before we remove ourselves from the list of live buffers. (Fbuffer_swap_text, Fset_buffer_multibyte): Don't check indirect dead buffers. (init_buffer_once): Don't set `all_buffers`. (init_buffer): Don't map new memory for dead buffers. * src/buffer.h (struct buffer): Remove `next` field. (FOR_EACH_BUFFER): Remove macro. * src/pdumper.c (dump_buffer): Don't dump the `next` field.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 31f497ea40a..abb1294d038 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -570,9 +570,6 @@ struct buffer
570 In an indirect buffer, this is the own_text field of another buffer. */ 570 In an indirect buffer, this is the own_text field of another buffer. */
571 struct buffer_text *text; 571 struct buffer_text *text;
572 572
573 /* Next buffer, in chain of all buffers, including killed ones. */
574 struct buffer *next;
575
576 /* Char position of point in buffer. */ 573 /* Char position of point in buffer. */
577 ptrdiff_t pt; 574 ptrdiff_t pt;
578 575
@@ -1104,15 +1101,6 @@ BUFFER_CHECK_INDIRECTION (struct buffer *b)
1104 } 1101 }
1105} 1102}
1106 1103
1107/* Chain of all buffers, including killed ones. */
1108
1109extern struct buffer *all_buffers;
1110
1111/* Used to iterate over the chain above. */
1112
1113#define FOR_EACH_BUFFER(b) \
1114 for ((b) = all_buffers; (b); (b) = (b)->next)
1115
1116/* This structure holds the default values of the buffer-local variables 1104/* This structure holds the default values of the buffer-local variables
1117 that have special slots in each buffer. 1105 that have special slots in each buffer.
1118 The default value occupies the same slot in this structure 1106 The default value occupies the same slot in this structure