• 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: Zeroing out instance variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Zeroing out instance variables


  • Subject: Re: Zeroing out instance variables
  • From: Kyle Sluder <email@hidden>
  • Date: Sat, 17 Apr 2010 16:04:24 -0700

On Sat, Apr 17, 2010 at 2:01 PM, Charles Srstka
<email@hidden> wrote:
> How about just giving your object only one instance variable, which is a pointer to a C struct, with all the object’s accessor methods pointing to elements in the struct? Then, all you’d have to do would be to swap out the struct for another one, or zero the struct. No runtime hacking, no assumptions about the internals of the object format.

And if allocation of *that* struct becomes a performance problem, swap
in a new allocator like jemalloc. I recently read something about
Blender enjoying a startling performance improvement by switching to
jemalloc, because they malloc and free tons of small structs.

--Kyle Sluder
_______________________________________________

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

  • Follow-Ups:
    • Re: Zeroing out instance variables
      • From: Ben Haller <email@hidden>
References: 
 >Zeroing out instance variables (From: Ben Haller <email@hidden>)
 >Re: Zeroing out instance variables (From: Ken Thomases <email@hidden>)
 >Re: Zeroing out instance variables (From: Ben Haller <email@hidden>)
 >Re: Zeroing out instance variables (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: Supporting different orientations with UITabBarView?
  • Next by Date: Converting an afp:NSURL to a filesystem path - or - Ya can't get there from here...
  • Previous by thread: Re: Zeroing out instance variables
  • Next by thread: Re: Zeroing out instance variables
  • Index(es):
    • Date
    • Thread