Re: preventing bad memory access
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