diff options
| author | Quentin Carbonneaux | 2014-09-08 09:38:54 -0400 |
|---|---|---|
| committer | Quentin Carbonneaux | 2014-09-08 09:39:07 -0400 |
| commit | de06a641b64a5e0aadb982b9714607cc5611b231 (patch) | |
| tree | c8bd1d5c14b247fd4bc46a0057429737093329f0 | |
| parent | 7b186bbeef8d205a90b800a69bb7504c7c3614fd (diff) | |
use a reasonable buffer size
| -rw-r--r-- | buf.h | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -4,24 +4,24 @@ typedef struct page Page; typedef struct buf Buf; enum { - PageLen = 11, + PageLen = 1024 - 8, }; struct page { - int len; - int nl; - int col; - Rune *hbeg; - Rune buf[PageLen]; - Page *p; - Page *n; + int len; /* page length */ + short nl; /* number of \n in page */ + short col; /* column of the first rune */ + Rune *hbeg; /* start of the hole */ + Page *p; /* link to previous */ + Page *n; /* link to next */ + Rune buf[PageLen]; /* buffer */ }; struct buf { - Page *p; - Page *last; - unsigned lastbeg; - unsigned limbo; + Page *p; /* first page */ + Page *last; /* cached page */ + unsigned lastbeg; /* buffer offset of last */ + unsigned limbo; /* limbo offset */ }; void buf_init(Buf *); |
