• 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: deallocation of related objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: deallocation of related objects


  • Subject: Re: deallocation of related objects
  • From: Daryn <email@hidden>
  • Date: Tue, 11 Mar 2003 20:39:21 -0600

On Tuesday, March 11, 2003, at 08:17 PM, Karl Kraft wrote:

On Tuesday, March 11, 2003, at 05:31 PM, Daryn wrote:

I have an interesting problem for which I'd like implementation suggestions. In the general sense, I need to be able to be able to invisibly attach metadata to any existing objc object. When the object is destroyed, then the metadata needs to be freed.

Do you really need to be able to attach it to any Objective-C object?
[...] Swizzle the isa at the original memory address to be a proxy object that forwards requests to the new object, and manages the added state. [...]

Largely yes, and I did think about trying to convert objects to proxies, but it seems too expensive. I'm binding objc data structures and objects into other languages -- perl at the moment. In short, this requires converting an id to a sv. Perl expects the same sv for the same underlying data object, so I'm using a NSMap to map ids to svs.

When the perl sv is destroyed I can trigger a release on the id. However, if the id is deallocated on the objc side, I need to be able to free the sv.

For those curious, this is not like Camel Bones. It's much better (for me anyway). I've implemented pure XS tie interfaces for perl-style data manipulation.

Daryn
_______________________________________________
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: deallocation of related objects (From: Karl Kraft <email@hidden>)

  • Prev by Date: Re: deallocation of related objects
  • Next by Date: Re: deallocation of related objects
  • Previous by thread: Re: deallocation of related objects
  • Next by thread: Re: deallocation of related objects
  • Index(es):
    • Date
    • Thread