Subj : Re: Crash in js_InitXMLClasses To : netscape.public.mozilla.jseng From : Brian Barnes Date : Sun Jul 24 2005 04:39 pm --Apple-Mail-1-45374855 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Jul 24, 2005, at 2:28 AM, Peter Wilson wrote: > Brian Barnes wrote: >> I'm getting a crash in "js_InitXMLClasses" after calling >> JS_InitStandardClasses. It has something to do with rooting, >> because if I remove any GC calls (I periodically call it when my >> game is between levels), it doesn't crash. >> >> Note that I pre-create the global object as a prototype, and use >> that to create all the "real" global objects that are attached to >> scripts. >> >> I attempted to undefine it when I compile (i.e., - >> UJS_HAS_XML_SUPPORT) but that doesn't seem to take it off. >> >> Three questions: >> >> 1. Any idea what could be causing this, >> 2. How do I remove this from the compile (is it defined in a >> config file somewhere?) >> 3. Is there documentation to all these defines so I can remove >> what isn't necessary? >> >> [>] Brian >> _______________________________________________ >> mozilla-jseng mailing list >> mozilla-jseng@mozilla.org >> http://mail.mozilla.org/listinfo/mozilla-jseng >> > > You shouldn't be calling js_InitXMLClasses - that's an internal > function. > > All you have to do to get XML is add JSOPTION_XML to your call to > JS_SetOptions. Eg in my case I have something like: > > JSContext cx = JS_NewContext(runttime, STACK_SIZE); > JS_SetOptions(cx,JS_GetOptions(cx)|JSOPTION_XML| > JSOPTION_VAROBJFIX); > > I didn't change compilation flags at all from previous versions of > the engine. I'm not calling it, spidermonkey calls it from JS_InitStandardClasses, and it crashes then. There's a define in the code (JS_HAS_XML_SUPPORT) which seems to be on. I'd just like to turn that OFF (don't need the XML support) to see if that fixes my crash, but I don't know where it's defined. It seems like that should be a compile time option, like JS_HAS_FILE_SUPPORT. As a matter of fact, I can't find the define anywhere except when it's used. [>] Brian --Apple-Mail-1-45374855 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1
Brian = Barnes wrote:I'm getting a crash in "js_InitXMLClasses" after calling = JS_InitStandardClasses.=A0 It has something to do with rooting, because = if I remove any GC calls (I periodically call it when my game is between = levels), it doesn't crash.
Note that I pre-create the global = object as a prototype, and use that to create all the "real" global = objects that are attached to scripts.
I attempted to = undefine it when I compile (i.e., -UJS_HAS_XML_SUPPORT) but that doesn't = seem to take it off.
Three questions:
1. Any = idea what could be causing this,
2. How do I remove this from the = compile (is it defined in a config file somewhere?)
3. Is there = documentation to all these defines so I can remove what isn't necessary? =
[>] Brian
= _______________________________________________
mozilla-jseng = mailing list
mozilla-jseng@mozilla.org =
http://mail.mozill= a.org/listinfo/mozilla-jseng
You = shouldn't be calling js_InitXMLClasses - that's an internal = function.
All you have to do to get XML is add JSOPTION_XML to = your call to JS_SetOptions. Eg in my case I have something like:
=
=A0=A0 JSContext cx =3D JS_NewContext(runttime, STACK_SIZE);
=A0=A0= = JS_SetOptions(cx,JS_GetOptions(cx)|JSOPTION_XML|JSOPTION_VAROBJFIX);
=
I didn't change compilation flags at all from previous versions of = the engine.