From: Jay Freeman (saurik) Date: Mon, 20 Jan 2014 12:43:48 +0000 (-0800) Subject: If possible, use the new debug synchronous GC API. X-Git-Tag: v0.9.500~23 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/d5fa31c512a3fefcc82ac3d757b25f59cd9c142a?ds=sidebyside If possible, use the new debug synchronous GC API. --- diff --git a/Execute.cpp b/Execute.cpp index a71d29f..0f7b61b 100644 --- a/Execute.cpp +++ b/Execute.cpp @@ -342,9 +342,10 @@ static JSValueRef $cyq(JSContextRef context, JSObjectRef object, JSObjectRef _th return CYCastJSValue(context, name); } CYCatch(NULL) } +static void (*JSSynchronousGarbageCollectForDebugging$)(JSContextRef); void CYGarbageCollect(JSContextRef context) { - JSGarbageCollect(context); + (JSSynchronousGarbageCollectForDebugging$ ?: &JSGarbageCollect)(context); } static JSValueRef Cycript_gc_callAsFunction(JSContextRef context, JSObjectRef object, JSObjectRef _this, size_t count, const JSValueRef arguments[], JSValueRef *exception) { CYTry { @@ -1445,6 +1446,7 @@ void CYInitializeDynamic() { else return; JSObjectMakeArray$ = reinterpret_cast(dlsym(RTLD_DEFAULT, "JSObjectMakeArray")); + JSSynchronousGarbageCollectForDebugging$ = reinterpret_cast(dlsym(RTLD_DEFAULT, "JSSynchronousGarbageCollectForDebugging")); JSClassDefinition definition;