[PATCH 06/12] Start actually parsing the git object data
Linus Torvalds
torvalds at linux-foundation.org
Sun Mar 9 20:48:05 PDT 2014
On Sun, Mar 9, 2014 at 8:14 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
>> +#define MAXLINE 100
>
> Can you remind me why this is a valid assumption?
> We simply ensure this max length when writing and then any tool outside
> of Subsurface that manipulates the git objects needs to make sure this
> is still enforced?
Note that the MAXLINE data doesn't contain the actual strings, so it's
basically "maximum data on a line that isn't strings".
And 100 is just a random value. I briefly considered making that
string a "membuffer" too and not have any limits, but I didn't see any
real upsides. We do protect in the line reading code against
overflowing, so if somebody edits lines by hand to be invalidly long,
we just truncate them.
The longest lines would be the sample lines that have all of the
fields, and I think you can get pretty close to a hundred if you have
all the fields (including heartbeat and bearing and all the stop times
and ddepths). Maybe we could make the 100 be 500, and it wouldn't even
be close.
Linus
More information about the subsurface
mailing list