• 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: Scott Ribe <email@hidden>
  • Date: Sun, 16 Nov 2008 21:37:03 -0700
  • Thread-topic: Two arrays sharing the same adress space.

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: Sandro Noel <email@hidden>
    • Re: Two arrays sharing the same adress space.
      • From: Sandro Noel <email@hidden>
References: 
 >Two arrays sharing the same adress space. (From: Sandro Noel <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