Go to the source code of this file.
◆ ML_CHNK_ADDLINE
#define ML_CHNK_ADDLINE 1 |
◆ ML_CHNK_DELLINE
#define ML_CHNK_DELLINE 2 |
◆ ML_CHNK_UPDLINE
#define ML_CHNK_UPDLINE 3 |
◆ ML_EMPTY
◆ ML_LINE_DIRTY
◆ ML_LOCKED_DIRTY
#define ML_LOCKED_DIRTY 4 |
◆ ML_LOCKED_POS
◆ chunksize_T
◆ infoptr_T
When searching for a specific line, we remember what blocks in the tree are the branches leading to that block. This is stored in ml_stack. Each entry is a pointer to info in a block (may be data block or pointer block)
◆ memline_T
memline structure: the contents of a buffer. Essentially a tree with a branch factor of 128. Lines are stored at leaf nodes. Nodes are stored on ml_mfp (memfile_T): pointer_block: internal nodes data_block: leaf nodes
Memline also has "chunks" of 800 lines that are separate from the 128-tree structure, primarily used to speed up line2byte() and byte2line().
Motivation: If you have a file that is 10000 lines long, and you insert a line at linenr 1000, you don't want to move 9000 lines in memory. With this structure it is roughly (N * 128) pointer moves, where N is the height (typically 1-3).