• 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: Module unlinking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Module unlinking


  • Subject: Re: Module unlinking
  • From: Chris Hanson <email@hidden>
  • Date: Mon, 13 Jan 2003 17:55:07 -0600

At 12:31 PM -0800 1/13/03, Matthew Formica wrote:
Take a look at NSBundle, CFBundle, and CFPlugin (and the docs for those).
We certainly allow for unloading modules, but you don't have to use such a
low-level API to do it.

And there's no way that I know of to remove a class from the Objective-C runtime. There's an objc_addClass, but no objc_removeClass.

This should be doable, and it is necessary for some applications (as the original poster suggests).[1] It just means that the whoever is doing the unloading needs to be willing to guarantee to the runtime that the class won't be used again once it's unloaded -- i.e. that there are no extant instances, that it has no subclasses, etc.

I think to remove a class, all one needs to do is remove any references to the class from the method cache, and remove the class itself from the class table. Is there anything else that needs to be done, runtime-wise, to add an objc_removeClass function?

-- Chris

[1] Another case where it could be necessary are other dynamic languages using the bridge. If I were to write a Smalltalk environment, I'd expect to be able to add and remove bridged classes at a whim while the environment is running. It would be a huge, huge hassle to have to take down the entire environment and load a new one just to change the definition of a subclass of NSView...

--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
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: Module unlinking (From: Matthew Formica <email@hidden>)

  • Prev by Date: Re: positioning items in a drawer
  • Next by Date: A legitimate argument for calling dealloc directly?
  • Previous by thread: Re: Module unlinking
  • Next by thread: Custom cells in tableview
  • Index(es):
    • Date
    • Thread