Mail Archives: djgpp/1996/04/12/00:23:50
I saw this happen too. I wrote a text editor that initially allocates 10K
for its buffer. As it reads in a file or as editing goes on, if it reaches
the end of 16K it reallocs it to 20K, and so forth.
When reading a file it checks after each line whether it's within one line
of the next 10K boundary, by seeing if it's up to 9744, 19744, or whatever
bytes. I accidentally had a bug where it didn't increment this properly
and still checked for 9744 bytes after passing the 10K mark, causing it to
allocate 10000 bytes every line. Then unawares I had it read in a large
file and it sat "thinking" for a while then crashed with a GPF of some
kind or another.
--
.*. "Clouds are not spheres, mountains are not cones, coastlines are not
-() < circles, and bark is not smooth, nor does lightning travel in a
`*' straight line." ,------------------------------------------------
-- B. Mandelbrot | Paul Derbyshire (PGD) ao950 AT freenet DOT carleton DOT ca
- Raw text -