Subj : Re: spidermonkey: reserved slot vs. private To : netscape.public.mozilla.jseng From : Jens Thiele Date : Sat Sep 18 2004 11:23 am Brendan Eich wrote: > They're unnamed by any property, scanned by the GC, got and set by > native code using the API. [...] > You may use a reserved slot for this flag. Thanks for the clarification. > Under what conditions would the JSObject *not* own the private data? for example if the private data is static or if native code did allocate it and will free it again (for example after js shutdown) my example: i wrapped std::streambuf and i have written a tcp/ip (socket) implementation of std::streambuf (those streams are created at runtime - with new) but the streambuf objects of std::cout/cin/cerr are not => those should never be freed (deleted) > In those cases, what protects the JSObject from having a dangling (or null, > if you JS_SetPrivate(cx, obj, NULL)) private? the private data's lifetime - but good comment/hint thanks ;-) Jens .