• Stefan Monnier's avatar
    Remove `all_buffers` and the associated `next` field of buffers · cddf85d2
    Stefan Monnier authored
    * 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.
    cddf85d2
buffer.h 46.8 KB