• 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: [Q] [NSValue valueWithBytes: objCType:]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] [NSValue valueWithBytes: objCType:]


  • Subject: Re: [Q] [NSValue valueWithBytes: objCType:]
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 31 Jul 2008 16:19:56 -0700


On 31 Jul '08, at 3:02 PM, JongAm Park wrote:

It is interesting that the exactly same memory blocks were allocated for the interested data and dataDesc.

It's actually pretty likely... malloc( ) often reuses a recently-freed block of the same size when it can, because this avoids heap fragmentation and improves caching.


If you really want to see what's going on, set the environment variable MallocScribble to 1 when running your program. This will cause newly allocated blocks to be filled with 0xAA and freed blocks to be filled with 0x55. It's a good way to track down references to uninitialized or freed memory.

—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


References: 
 >[Q] [NSValue valueWithBytes: objCType:] (From: JongAm Park <email@hidden>)
 >Re: [Q] [NSValue valueWithBytes: objCType:] (From: Jens Alfke <email@hidden>)
 >Re: [Q] [NSValue valueWithBytes: objCType:] (From: JongAm Park <email@hidden>)

  • Prev by Date: Re: Thread safety with background fetching
  • Next by Date: Re: Thread safety with background fetching
  • Previous by thread: Re: [Q] [NSValue valueWithBytes: objCType:]
  • Next by thread: Adding an NSColor subclass to NSColorPanel?
  • Index(es):
    • Date
    • Thread