• 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: Stupid objective-c question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stupid objective-c question


  • Subject: Re: Stupid objective-c question
  • From: Britt Durbrow <email@hidden>
  • Date: Mon, 26 Sep 2016 13:52:47 -0700

> On Sep 26, 2016, at 3:31 AM, Slipp Douglas Thompson <email@hidden> wrote:
>
> I'm sorry if I'm not up to snuff on compiler architecture, but how would a pointer to the memory address of that same pointer ever collide with any other pointer?

When ***Somebody*** is Doing It Wrong.

Having been bitten before by this phenomenon (i.e, others doing bizarre, illogical things; often in oddball close-source code libraries and/or drivers); I felt compelled to point out that non-collision wasn’t an *absolute* guarantee, but rather just a reasonable assumption *almost* always.

In other words, just when you think you’ve got it Idiot Proof, somebody goes and invents a better Idiot…

:-)

>  Only one thing may exist at at time at a given memory address, so— yes, if you're assigning arbitrary values into a pointer instead of an actual valid memory address you could have a problem, but that usage in itself is the smell.

It’s not *you* - the good, sane programmer - who’s doing that. It’s the other guy who’s Doing It Wrong… but it shows up as misbehavior in *your* code, leading *you* to tear your hair out.

And yes, the malodorousness of that code is positively wretched… 8-p


Alternatively, a memory scribbler or leakage via an improperly initialized variable may induce similar misbehavior (so, one should not assume that just because it *shouldn’t* happen under sane circumstances, that it *can’t* when facing a bug).

:-)
_______________________________________________

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


References: 
 >Stupid objective-c question (From: Gabriel Zachmann <email@hidden>)
 >Re: Stupid objective-c question (From: Graham Cox <email@hidden>)
 >Re: Stupid objective-c question (From: Quincey Morris <email@hidden>)
 >Re: Stupid objective-c question (From: Graham Cox <email@hidden>)
 >Re: Stupid objective-c question (From: Doug Hill <email@hidden>)
 >Re: Stupid objective-c question (From: Jens Alfke <email@hidden>)
 >Re: Stupid objective-c question (From: Gabriel Zachmann <email@hidden>)
 >Re: Stupid objective-c question (From: Quincey Morris <email@hidden>)
 >Re: Stupid objective-c question (From: Sandor Szatmari <email@hidden>)
 >Re: Stupid objective-c question (From: Uli Kusterer <email@hidden>)
 >Re: Stupid objective-c question (From: Britt Durbrow <email@hidden>)

  • Prev by Date: Re: Stupid objective-c question
  • Next by Date: XCode documentation browser
  • Previous by thread: Re: Stupid objective-c question
  • Next by thread: Re: Stupid objective-c question
  • Index(es):
    • Date
    • Thread