1020 |
|
|
1021 |
/* Lisp_Strings are allocated in string_block structures. When a new |
/* Lisp_Strings are allocated in string_block structures. When a new |
1022 |
string_block is allocated, all the Lisp_Strings it contains are |
string_block is allocated, all the Lisp_Strings it contains are |
1023 |
added to a free-list stiing_free_list. When a new Lisp_String is |
added to a free-list string_free_list. When a new Lisp_String is |
1024 |
needed, it is taken from that list. During the sweep phase of GC, |
needed, it is taken from that list. During the sweep phase of GC, |
1025 |
string_blocks that are entirely free are freed, except two which |
string_blocks that are entirely free are freed, except two which |
1026 |
we keep. |
we keep. |
4096 |
nextb->undo_list |
nextb->undo_list |
4097 |
= truncate_undo_list (nextb->undo_list, undo_limit, |
= truncate_undo_list (nextb->undo_list, undo_limit, |
4098 |
undo_strong_limit); |
undo_strong_limit); |
4099 |
|
|
4100 |
|
/* Shrink buffer gaps, but skip indirect and dead buffers. */ |
4101 |
|
if (nextb->base_buffer == 0 && !NILP (nextb->name)) |
4102 |
|
{ |
4103 |
|
/* If a buffer's gap size is more than 10% of the buffer |
4104 |
|
size, or larger than 2000 bytes, then shrink it |
4105 |
|
accordingly. Keep a minimum size of 20 bytes. */ |
4106 |
|
int size = min (2000, max (20, (nextb->text->z_byte / 10))); |
4107 |
|
|
4108 |
|
if (nextb->text->gap_size > size) |
4109 |
|
{ |
4110 |
|
struct buffer *save_current = current_buffer; |
4111 |
|
current_buffer = nextb; |
4112 |
|
make_gap (-(nextb->text->gap_size - size)); |
4113 |
|
current_buffer = save_current; |
4114 |
|
} |
4115 |
|
} |
4116 |
|
|
4117 |
nextb = nextb->next; |
nextb = nextb->next; |
4118 |
} |
} |
4119 |
} |
} |