Re: EXC_BAD_ACCESS when running from different drive
Re: EXC_BAD_ACCESS when running from different drive
- Subject: Re: EXC_BAD_ACCESS when running from different drive
- From: Marshall Clow <email@hidden>
- Date: Wed, 28 Sep 2005 10:23:30 -0700
At 10:05 AM -0700 9/28/05, Stefan Werner wrote:
Hi,
a closer look reveals that apparently, when run from the root drive,
my program's resources (read from a .rsrc file inside the MachO app
bundle) are in a read-only memory area (at least, any attempt to
write over loaded resources fails) where they're writable when my
program is being launched from a non-boot drive.
Is this expected behavior? Are resources supposed to be in read-only
memory and my program is misbehaving?
Yes, this is expected (by some) behavior.
Resource files that are opened readonly for you (like ones in your
bundle) are mapped into your address space (read only), rather than
being read into memory. This means that you can't go poking into the
resources, (like PowerPlant did with it's font handling). It also
means that any alignment guarantees that you might expect are null
and void (things like handles being aligned on 16 byte boundaries -
handy for Altivec, say).
If the file can't be mapped into your address space, then the
resource file is opened "normally", and resources are read into
memory as you request them.
--
-- Marshall
Marshall Clow Idio Software <mailto:email@hidden>
It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed,
the hands acquire shaking, the shaking becomes a warning.
It is by caffeine alone I set my mind in motion.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden