diff options
| author | Dmitry Antipov | 2012-07-20 20:05:47 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-07-20 20:05:47 +0400 |
| commit | 9928463dcdb0164477785e83406602065de79ef8 (patch) | |
| tree | 14d6b28885b7e333733ff4eb62275e6e425f81b3 /src/buffer.h | |
| parent | f8643a6b9e35af22b69a84f83df5d9410de82f16 (diff) | |
| download | emacs-9928463dcdb0164477785e83406602065de79ef8.tar.gz emacs-9928463dcdb0164477785e83406602065de79ef8.zip | |
Add indirection counting to speed up Fkill_buffer.
* buffer.h (struct buffer): New member.
* buffer.c (Fget_buffer_create): Set indirection counter to 0.
(Fmake_indirect_buffer): Set indirection counter to -1, increment
base buffer indirection counter.
(compact_buffer): If ENABLE_CHECKING, verify indirection counters.
(Fkill_buffer): Adjust indirection counters as needed, don't walk
through buffer list if indirection counter is 0.
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index a97cc13705b..69be4dc7773 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -775,6 +775,11 @@ struct buffer | |||
| 775 | In an ordinary buffer, it is 0. */ | 775 | In an ordinary buffer, it is 0. */ |
| 776 | struct buffer *base_buffer; | 776 | struct buffer *base_buffer; |
| 777 | 777 | ||
| 778 | /* In an indirect buffer, this is -1. In an ordinary buffer, | ||
| 779 | it's the number of indirect buffers which shares our text; | ||
| 780 | zero means that we're the only owner of this text. */ | ||
| 781 | int indirections; | ||
| 782 | |||
| 778 | /* A non-zero value in slot IDX means that per-buffer variable | 783 | /* A non-zero value in slot IDX means that per-buffer variable |
| 779 | with index IDX has a local value in this buffer. The index IDX | 784 | with index IDX has a local value in this buffer. The index IDX |
| 780 | for a buffer-local variable is stored in that variable's slot | 785 | for a buffer-local variable is stored in that variable's slot |