• 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
Create NSStrings from a mapped NSData object - safe?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Create NSStrings from a mapped NSData object - safe?


  • Subject: Create NSStrings from a mapped NSData object - safe?
  • From: Daniel Vollmer <email@hidden>
  • Date: Tue, 13 May 2008 08:38:46 +0200

Salutations!

I'm parsing a rather large text-file (usually >20MB) and in doing so I'm iterating over its lines with [String getParagraphStart::::]. I've found a rather noticeable speed-up in the parsing operation if I create the string in question from an NSData object (created via initWithContentsOfMappedFile) using [String initWithData:encoding:].

Now to the questions:
1) Is this safe if the file in question is being moved / deleted / edited during parsing?


2) Are substrings created from the original string (e.g. substringWithRange etc.) still backed properly after the original string and the NSData object are released?


Thanks for any pointers, Daniel. _______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Create NSStrings from a mapped NSData object - safe?
      • From: Jens Alfke <email@hidden>
    • Re: Create NSStrings from a mapped NSData object - safe?
      • From: Michael Vannorsdel <email@hidden>
  • Prev by Date: Re: list open application windows
  • Next by Date: Re: Create NSStrings from a mapped NSData object - safe?
  • Previous by thread: Re: list open application windows
  • Next by thread: Re: Create NSStrings from a mapped NSData object - safe?
  • Index(es):
    • Date
    • Thread