From: Bert Wesarg Date: Thu, 05 May 2011 05:47:43 GMT Subject: Re: [PATCH V2 4/5] git-grep: Learn PCRE Message-ID: In-Reply-To: <7vk4e6c5rh.fsf@alter.siamese.dyndns.org> 2011/5/5 Junio C Hamano : > Michał Kiedrowicz 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