Re: AGRegex Memory Hog Bug
Re: AGRegex Memory Hog Bug
- Subject: Re: AGRegex Memory Hog Bug
- From: Ben Dougall <email@hidden>
- Date: Mon, 8 Sep 2003 02:28:19 +0100
On Monday, September 8, 2003, at 12:23 am, Aram Greenman wrote:
If you're using AGRegex <http://sf.net/projects/agkit/>, you may have
noticed that it sucks a lot of memory when matching against a large
target string (thanks to Ben Dougall for pointing this out). This is
because it copies the target string into the AGRegexMatch instance. I
chose to copy, rather than retain, the target string so the
AGRegexMatch would still be able to return groups even if the target
string was later modified, but unfortunately this leads to an
unacceptable level of memory use in certain cases. Since this can't be
repaired without a behavior or API change or both, I'm soliciting
comments on the possible fixes:
1. Retain instead of copy the target string, and warn that the target
string shouldn't be modified while the match is being used. But, I
don't really like this idea since it can't be enforced.
if its an NSString, as opposed to an NSMutableString, that's being
searched, then that is an already built in enforcement of no change
isn't it? i'm not sure what should happen in the case of an
NSMutableString but when it's an NSString just retaining wouldn't be a
problem at all would it?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.