From d5fa31c512a3fefcc82ac3d757b25f59cd9c142a Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 20 Jan 2014 04:43:48 -0800 Subject: [PATCH] If possible, use the new debug synchronous GC API. --- Execute.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.47.2