Commit 3e98c68e authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

* alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.

parent 9d7f027b
2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
* alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
 
* commands.h (immediate_quit): Remove duplicate decl.
......
......@@ -6311,19 +6311,14 @@ gc_sweep (void)
/* Free all unmarked buffers */
{
register struct buffer *buffer = all_buffers, *prev = 0, *next;
register struct buffer *buffer, **bprev = &all_buffers;
total_buffers = 0;
while (buffer)
for (buffer = all_buffers; buffer; buffer = *bprev)
if (!VECTOR_MARKED_P (buffer))
{
if (prev)
prev->header.next = buffer->header.next;
else
all_buffers = buffer->header.next.buffer;
next = buffer->header.next.buffer;
*bprev = buffer->header.next.buffer;
lisp_free (buffer);
buffer = next;
}
else
{
......@@ -6331,7 +6326,7 @@ gc_sweep (void)
/* Do not use buffer_(set|get)_intervals here. */
buffer->text->intervals = balance_intervals (buffer->text->intervals);
total_buffers++;
prev = buffer, buffer = buffer->header.next.buffer;
bprev = &buffer->header.next.buffer;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment