aboutsummaryrefslogtreecommitdiffstats
path: root/line.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-22 14:32:16 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-22 14:32:16 -0800
commitfa00fe882f719351fdf7a4c4100baf4f3eab4d61 (patch)
tree8ea97ceb12328399fbb48bc8769f050376c4703a /line.h
parent25f0141df133f3522c6d23ddd96ae341813b9638 (diff)
downloaduemacs-master.tar.gz
Stop using 'short' for line and allocation sizesHEADmaster
Yes, yes, it probably made sense 30 years ago as a way to save a tiny amount of memory, but especially when interspersed in structures that have pointers (aligned to 64 bits these days), it's not even saving memory today. And it makes us fail in nasty ways when looking at files with long lines. So just make them 'int'. And if you have a line that is longer than 2GB, you only have yourself to blame. I no longer care. In case anybody care, the "test-case" for this was a lovely UDDF file with a binary divecomputer dump encoded as an XML element. Resulting in a lovely 41kB single line. Not what poor micro-emacs was designed for, I'm afraid. I really should just learn another editor, rather than continue to polish this turd. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'line.h')
-rw-r--r--line.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/line.h b/line.h
index 9eaad61..7b07a3b 100644
--- a/line.h
+++ b/line.h
@@ -14,8 +14,8 @@
struct line {
struct line *l_fp; /* Link to the next line */
struct line *l_bp; /* Link to the previous line */
- short l_size; /* Allocated size */
- short l_used; /* Used size */
+ int l_size; /* Allocated size */
+ int l_used; /* Used size */
char l_text[1]; /* A bunch of characters. */
};