Re: Two arrays sharing the same adress space.
Re: Two arrays sharing the same adress space.
- Subject: Re: Two arrays sharing the same adress space.
- From: Sandro Noel <email@hidden>
- Date: Sun, 16 Nov 2008 23:54:15 -0500
Forgot to answer the first question.
This is a debug built, and I'm checking in the code where mounts is
being assigned objects
I have not enabled any optimization that I know of ...
Sandro Noel.
On 16-Nov-08, at 11:37 PM, Scott Ribe wrote:
At what point in the code are you checking? Is this a release build,
or a
debug build in which you've gone & enabled some optimizations?
In the code you posted mounts is init'd (twice actually, which is
unecessary), then never used. It's perfectly possible that the two
variables
mounts & bonjourServices will be stored in the same register--
depending on
compiler settings.
In other words, the two arrays would certainly have different
addresses. But
since you're not referring to mounts after it's initialized, the
space where
the pointer to mounts is stored can be reused to store the different
pointer
to bonjourServices.
Step it line by line, and watch the values of those variables. Or
actually
do something with mounts later in the method. Or get rid of mounts
if you're
not going to use it.
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice
_______________________________________________
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