bustage fix
authorRobert Sayre <sayrer@gmail.com>
Thu, 29 Oct 2009 11:48:18 -0700
changeset 34383 88cfae411a2a
parent 34382 17aa7254a43c
child 34384 5c082fd6dc4b
push id10005
push userrsayre@mozilla.com
push date2009-10-29 21:11 +0000
treeherdermozilla-central@d588945739a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.3a1pre
bustage fix
js/src/jsapi.cpp
js/src/jsapi.h
js/src/xpconnect/src/xpcwrappednative.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -1847,16 +1847,22 @@ JS_realloc(JSContext *cx, void *p, size_
 }
 
 JS_PUBLIC_API(void)
 JS_free(JSContext *cx, void *p)
 {
     return cx->free(p);
 }
 
+JS_PUBLIC_API(void)
+JS_updateMallocCounter(JSContext *cx, size_t nbytes)
+{
+    return cx->updateMallocCounter(nbytes);
+}
+
 JS_PUBLIC_API(char *)
 JS_strdup(JSContext *cx, const char *s)
 {
     size_t n;
     void *p;
 
     n = strlen(s) + 1;
     p = cx->malloc(n);
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -857,16 +857,19 @@ extern JS_PUBLIC_API(void *)
 JS_malloc(JSContext *cx, size_t nbytes);
 
 extern JS_PUBLIC_API(void *)
 JS_realloc(JSContext *cx, void *p, size_t nbytes);
 
 extern JS_PUBLIC_API(void)
 JS_free(JSContext *cx, void *p);
 
+extern JS_PUBLIC_API(void)
+JS_updateMallocCounter(JSContext *cx, size_t nbytes);
+
 extern JS_PUBLIC_API(char *)
 JS_strdup(JSContext *cx, const char *s);
 
 extern JS_PUBLIC_API(jsdouble *)
 JS_NewDouble(JSContext *cx, jsdouble d);
 
 extern JS_PUBLIC_API(JSBool)
 JS_NewDoubleValue(JSContext *cx, jsdouble d, jsval *rval);
--- a/js/src/xpconnect/src/xpcwrappednative.cpp
+++ b/js/src/xpconnect/src/xpcwrappednative.cpp
@@ -1188,17 +1188,17 @@ XPCWrappedNative::FinishInit(XPCCallCont
     mThread = do_GetCurrentThread();
 
     if(HasProto() && GetProto()->ClassIsMainThreadOnly() && !NS_IsMainThread())
         DEBUG_ReportWrapperThreadSafetyError(ccx,
             "MainThread only wrapper created on the wrong thread", this);
 #endif
 
     // A hack for bug 517665, increase the probability for GC.
-    ccx.GetJSContext()->updateMallocCounter(2 * sizeof(XPCWrappedNative));
+    JS_updateMallocCounter(ccx.GetJSContext(), 2 * sizeof(XPCWrappedNative));
 
     return JS_TRUE;
 }
 
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(XPCWrappedNative)
   NS_INTERFACE_MAP_ENTRY(nsIXPConnectWrappedNative)
   NS_INTERFACE_MAP_ENTRY(nsIXPConnectJSObjectHolder)