• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: MOKit memory problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MOKit memory problem


  • Subject: Re: MOKit memory problem
  • From: Nico <email@hidden>
  • Date: Mon, 12 Aug 2002 09:30:06 +0200

Here's the code I use :

- (NSDictionary *)parse:(NSString *)string
{
NSString *myInfo1, *myInfo2;
MORegularExpression *regexp;

if ([[MORegularExpression regularExpressionWithString:@".* some RE .*?
:.*"] matchesString:string])
{
regexp = [MORegularExpression regularExpressionWithString:@"(.*) some
RE (.*?) :(.*)"];
myInfo1 = [regexp substringForSubexpressionAtIndex:1
inString:string];
myInfo2 = [regexp substringForSubexpressionAtIndex:2
inString:string];
} else if ... // here I verify whether the string matches another regexp
{




} else if ... {
// etc..
}

// i return an NSDictionary* created using the strings (myInfo1 and/or
myInfo2, and many others)
}

(regexp is used only is the currend method, which is called each time a new
data is read from a socket. This method is used to match what kind of info
we've just retrieved from an IRC server)

MallocDebug indicates the major part of the memory is allocated for
MORegularExpression.

Please tell me if I didn't something *WRONG* :]
Thanks you :>
Nico


On 12/08/02 3:30, "Brock Brandenberg" <email@hidden> wrote:

> Hundreds? It certainly isn't a lightweight class, so it's understandable
> that it will use RAM. How are you using the regex objects? Are you keeping
> hundreds around for the life of the program or are you creating, using, and
> releasing numerous times?
>
> Brock
_______________________________________________
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.

  • Follow-Ups:
    • Re: MOKit memory problem
      • From: Brock Brandenberg <email@hidden>
    • Re: MOKit memory problem
      • From: Marcel Weiher <email@hidden>
  • Prev by Date: Re: Classes and the Production of Objects
  • Next by Date: Re: NSView initWithFrame called twice
  • Previous by thread: MOKit memory problem
  • Next by thread: Re: MOKit memory problem
  • Index(es):
    • Date
    • Thread