while([inputString isMatchedByRegex:regexString]){
range = [inputString rangeOfRegex:regexString];
inputString = [inputString stringByReplacingCharactersInRange:range
withString:@""];
}
'inputString' is a 5mb text file, Activity Monitor shows that memory
increases by about 9mb per iteration. Which quickly becomes a serious
problem.
I'm a little confused as to why I have a problem. My understanding is
that 'inputString' (on the third line) is replaced by the modified
version of itself. I was expecting the memory footprint for the app to
reduce in size (if anything). Obviously I have the concept
fundamentally wrong in my head.
a pointer address when replaced by another address free's up the old
memory location it once pointed to, no?
By the way I'm using RegexKit. And I'm a little rusty as have not
programed the mac for some considerable time.
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com