0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 7.4.2018

Problem:    buf_valid() can be slow when there are many buffers.
Solution:   Add bufref_valid(), only go through the buffer list when a buffer
            was freed.
This commit is contained in:
Bram Moolenaar
2016-07-10 18:21:50 +02:00
parent 8240433f48
commit b25f9a97e9
5 changed files with 108 additions and 29 deletions

View File

@@ -69,6 +69,14 @@ typedef struct frame_S frame_T;
typedef int scid_T; /* script ID */
typedef struct file_buffer buf_T; /* forward declaration */
/* Reference to a buffer that stores the value of buf_free_count.
* bufref_valid() only needs to check "buf" when the count differs.
*/
typedef struct {
buf_T *br_buf;
int br_buf_free_count;
} bufref_T;
/*
* This is here because regexp.h needs pos_T and below regprog_T is used.
*/