[webkit-dev] JSxxxRelease/Retain - some guidance?

Patrick Mueller pmuellr at muellerware.org
Thu Mar 26 08:27:29 PDT 2009

Looking at JavaScriptCore APIs, the doc on the Release/Retain functions 
for JSGlobalContext, JSClass, and JSString are underwhelming.  I'm 
wondering if someone can provide me a pointer to guidance on usage.

There are two things I'm thinking of here.  I'm familiar from Java JNI 
and other 'native' bindings for languages for the needs of 'pinning' 
objects both to keep them from moving and/or keep them from being GC'd. 
  Release/Retain could be related to that.

OTOH, I know there's some kind of Release/Retain dance in the ObjectiveC 
world as it relates to the memory management scheme of using pools to 
manage memory.  Release/Retain could be related to that.

Guessing the second, as there isn't a Release/Retain story for 
JSObject/JSValue itself, for instance.  If I'm doing straight up C 
programming, no Cocoa, or Obj-C stuff at all, do I need to worry about 
this stuff at all, or is there a common pattern I should be using?  Do I 
NEED to be using memory pools (or whatever they're called) to be doing 
kosher memory management for, say, long-lived processes where these 
Retain-able things are coming and going?

Patrick Mueller - http://muellerware.org

More information about the webkit-dev mailing list