]> git.eshelyaron.com Git - emacs.git/commit
Remove `all_buffers` and the associated `next` field of buffers
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 31 Mar 2020 23:45:22 +0000 (19:45 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 31 Mar 2020 23:45:45 +0000 (19:45 -0400)
commitcddf85d256dda8db1fad50e8e766fd7694361b8f
treed6cd89343e879eedf1ca46be759b53388f529096
parenta477a7b86ba7c59a90b18283cc86769c27de6c7c
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.
src/alloc.c
src/buffer.c
src/buffer.h
src/pdumper.c