From: Michal Rokos Date: 2002-08-29T00:37:20+09:00 Subject: Re: [Update] Port match to new dup, clone framework Hello, On Thu, Aug 29, 2002 at 12:18:49AM +0900, nobu.nokada@softhome.net wrote: > You mean this? ;-) > /(.*)/=~"foo"; $~.become(Regexp.allocate) > will leak memory. I knew that you will definitely find some bug in it. (Shame on me! I should definitely think more or upgrade my dead brain :-) > > - re_copy_registers(clone->regs, RMATCH(match)->regs); > + if (obj == orig) return obj; > > + RMATCH(obj)->str = RMATCH(orig)->str; > + re_free_registers(RMATCH(obj)->regs); > > + RMATCH(obj)->regs->allocated = 0; > > + re_copy_registers(RMATCH(obj)->regs, RMATCH(orig)->regs); Is it OK to commit patch with these changes? Michal -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michal Rokos Czech Technical University, Prague E-mail:m.rokos@sh.cvut.cz ICQ:36118339 Jabber:majkl@jabber.cz -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-