vim-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.

b25f9a97e9
This commit is contained in:
Marco Hinz
2017-01-09 02:03:03 +01:00
committed by James McCoy
parent 951dd1571c
commit e177226d51
4 changed files with 119 additions and 52 deletions

View File

@@ -8,6 +8,13 @@
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;
// for garray_T
#include "nvim/garray.h"
// for pos_T, lpos_T and linenr_T