• 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: Two arrays sharing the same adress space.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:52:40 -0500

Scott.

thank you for your explanation.

Mounts is being used, but just not in the init function.
it is being used later in the code.

that is why i was geting confused because the 2 arrays, are not meant to hold the same type of data.
and right now, they contain mixed data type.


witch makes my other functions crash.

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


  • Follow-Ups:
    • Re: Two arrays sharing the same adress space.
      • From: Scott Ribe <email@hidden>
References: 
 >Re: Two arrays sharing the same adress space. (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: Two arrays sharing the same adress space.
  • Next by Date: Re: Two arrays sharing the same adress space.
  • Previous by thread: Re: Two arrays sharing the same adress space.
  • Next by thread: Re: Two arrays sharing the same adress space.
  • Index(es):
    • Date
    • Thread