• 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: preventing bad memory access
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: preventing bad memory access


  • Subject: Re: preventing bad memory access
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 20 Oct 2011 20:48:29 -0700

On Oct 20, 2011, at 8:19 PM, Wilker wrote:

> I mean I will use the f* operations.
> But they are really safe? There is anything that I can do for extreme
> situations in case to avoid bad memory access?

What’s unsafe is accessing file-mapped memory after the file becomes unavailable.

If you use fread (or read), you’re not doing that. You're allocating your own memory from the heap first, then copying data from the file into it. There’s nothing dangerous about that. The memory will be available until you explicitly free it.

—Jens_______________________________________________

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: preventing bad memory access
      • From: Don Quixote de la Mancha <email@hidden>
References: 
 >preventing bad memory access (From: Wilker <email@hidden>)
 >Re: preventing bad memory access (From: Jens Alfke <email@hidden>)
 >Re: preventing bad memory access (From: Don Quixote de la Mancha <email@hidden>)
 >Re: preventing bad memory access (From: Wilker <email@hidden>)

  • Prev by Date: Re: preventing bad memory access
  • Next by Date: Re: preventing bad memory access
  • Previous by thread: Re: preventing bad memory access
  • Next by thread: Re: preventing bad memory access
  • Index(es):
    • Date
    • Thread