Re: Optionals? A better option!
Re: Optionals? A better option!
- Subject: Re: Optionals? A better option!
- From: Jens Alfke <email@hidden>
- Date: Fri, 15 May 2015 11:22:58 -0700
> On May 15, 2015, at 10:12 AM, Scott Ribe <email@hidden> wrote:
>
> As in the olden days of OS 9 & before, when you could freely read & write through location 0, usually leading to great hilarity…
Especially since the 68k CPU interrupt vectors were stored in low memory a few bytes from 0, so a memcpy or struct write to NULL would cause an immediate total system freeze.
Anyone who was developing for the Mac in those dark days remembers the indispensable system extension EvenBetterBusError (son of Mr. Bus Error), which would every few milliseconds (a) write an invalid address to location 0, and (b) trigger an exception if that value had been changed since it last wrote it. It wouldn’t catch dereferencing a null pointer, but it would catch dereferencing a null _handle_, and those were at least as common back then.
See: http://www.mactech.com/articles/mactech/Vol.13/13.05/CodeMechanic/index.html <http://www.mactech.com/articles/mactech/Vol.13/13.05/CodeMechanic/index.html>
—Jens
_______________________________________________
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