• 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: Malloc()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Malloc()


  • Subject: Re: Malloc()
  • From: Jim Correia <email@hidden>
  • Date: Wed, 3 Apr 2002 15:07:32 -0500

On Wednesday, April 3, 2002, at 01:25 PM, Kaelin Colclasure wrote:

Following your logic above, better to use sizeof (*pointer).

I know it is an inconsistent ruleset when compared to each other, but when
applied consistently throughout my code it has caught/prevented bugs from
shipping.

By using indirection you eliminate the inconsistency, and further reduce the
chance of the class of error you allude to above.

That makes sense. (Honestly, I didn't know you could do indirection in the sizeof operator, but upon reflection, I guess I had no valid basis for that assumption, and have just re-read what the C++ spec has to say about sizeof - (I don't have the latest C spec handy)).

Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Malloc() (From: Kaelin Colclasure <email@hidden>)

  • Prev by Date: Re: Premature _NSAutoreleaseNoPool() warnings -And more
  • Next by Date: Re: Strange Error when importing talkd.h
  • Previous by thread: Re: Malloc()
  • Next by thread: Re: Malloc()
  • Index(es):
    • Date
    • Thread