• 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: WTF? How can this work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WTF? How can this work?


  • Subject: Re: WTF? How can this work?
  • From: Chris Gehlker <email@hidden>
  • Date: Mon, 20 Aug 2001 19:18:14 -0700

On 8/20/01 6:21 PM, "John C. Randolph" <email@hidden> wrote:

>>> You're in luck, because there isn't any error checking on the
>>> fundamental containers. If you want an array with no bounds checking,
>>> just say:
>>>
>>> id unsafeArray[];
>>
>> I am in luck because it looks like exactly what I wanted. I'm being
>> sincere
>> here, this is not sarcasm. You've been very helpful. It looks like a
>> plain
>> old C array with object semantics. Just the ticket.
>
> Umm, no, it's a plain old C array with plain old C semantics. It just
> happens to be an array of id's.

Yep,
I noticed the [] after I got all enthusiastic and felt silly for awhile.
Then I realized you message could be interpreted as "start with a vanilla
array of ids, which is really just an array of pointers, and wrap whatever
object semantics you want around it. Then in the two spots where you need
fast indexing, just use C.

[snip]

>Perhaps, but the fact is that a vast number of security problems in
>todays computers are due to the fact that C doesn't do bounds-checking
>of arrays or strings.

True but checking every array is, IMO, overkill. Most everyone knows about
buffer overflow exploits these days.
--
Nature will bear the closest inspection. She invites us to lay our eye
level with her smallest leaf, and take an insect view of its plain. -Henry
David Thoreau, naturalist and author (1817-1862)


  • Follow-Ups:
    • Re: WTF? How can this work?
      • From: "John C. Randolph" <email@hidden>
References: 
 >Re: WTF? How can this work? (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Opening Files by Dropping on Application Icon
  • Next by Date: Re: Sheet interferes with close widget and app quit
  • Previous by thread: Re: WTF? How can this work?
  • Next by thread: Re: WTF? How can this work?
  • Index(es):
    • Date
    • Thread