Re: [PATCH V2 4/5] git-grep: Learn PCRE
- From
Bert Wesarg <bert.wesarg@googlemail.com>
- Date
- May 5, 2011, 05:47 UTC
- Message-ID
- <BANLkTik6pcz696xJyoOju8a3ToResLF+3w@mail.gmail.com>
- In-Reply-To
- <7vk4e6c5rh.fsf@alter.siamese.dyndns.org>
2011/5/5 Junio C Hamano <gitster@pobox.com>:
Show 12 quoted lines
> Michał Kiedrowicz <michal.kiedrowicz@gmail.com> writes:
>
>> @@ -33,6 +39,8 @@ struct grep_pat {
>> size_t patternlen;
>> enum grep_header_field field;
>> regex_t regexp;
>> + pcre *pcre_regexp;
>> + pcre_extra *extra;
>
> I don't think pcre will forever stay the _only_ thing that wants to hook
> an extra information to this structure. That is why I included "pcre_" in
> the field name in my earlier "how about doing it this way" suggestion.I would also suggest to share the space between regex_t and the (pcre*,pcre_extra*) tuple, like i did in my patch titled 'prepare for re-using the space...' from May 2. Sacrificing one bit to indicate that this is a pcre compiled pattern should not hurt, because there are bits left.
Bert