Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
ebd95c1c
Commit
ebd95c1c
authored
Jul 30, 2021
by
Nikolay Igotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Even more careful search for objc internals.
parent
371455b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
MetalRedrawer.mm
skiko/src/jvmMain/objectiveC/macos/MetalRedrawer.mm
+10
-4
No files found.
skiko/src/jvmMain/objectiveC/macos/MetalRedrawer.mm
View file @
ebd95c1c
...
...
@@ -113,15 +113,19 @@ JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_redrawer_MetalRedrawer_makeMeta
return (jlong) renderTarget;
}
typedef void* (*objc_autoreleasePoolPush_t)(void);
typedef void (*objc_autoreleasePoolPop_t)(void*);
static void* objc_library() {
void* result = dlopen("/usr/lib/libobjc.dylib", RTLD_LAZY | RTLD_LOCAL);
return result != NULL ? result : RTLD_DEFAULT;
}
JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_redrawer_MetalRedrawer_startRendering(
JNIEnv * env, jobject redrawer)
{
typedef void* (*objc_autoreleasePoolPush_t)(void);
static objc_autoreleasePoolPush_t objc_autoreleasePoolPush = NULL;
if (objc_autoreleasePoolPush == NULL) {
objc_autoreleasePoolPush = (objc_autoreleasePoolPush_t)dlsym(RTLD_DEFAULT, "objc_autoreleasePoolPush");
objc_autoreleasePoolPush = (objc_autoreleasePoolPush_t)dlsym(objc_library(), "objc_autoreleasePoolPush");
assert(objc_autoreleasePoolPush != NULL);
}
return (jlong)objc_autoreleasePoolPush();
}
...
...
@@ -129,9 +133,11 @@ JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_redrawer_MetalRedrawer_startRen
JNIEXPORT void JNICALL Java_org_jetbrains_skiko_redrawer_MetalRedrawer_endRendering(
JNIEnv * env, jobject redrawer, jlong handle)
{
typedef void (*objc_autoreleasePoolPop_t)(void*);
static objc_autoreleasePoolPop_t objc_autoreleasePoolPop = NULL;
if (objc_autoreleasePoolPop == NULL) {
objc_autoreleasePoolPop = (objc_autoreleasePoolPop_t)dlsym(RTLD_DEFAULT, "objc_autoreleasePoolPop");
objc_autoreleasePoolPop = (objc_autoreleasePoolPop_t)dlsym(objc_library(), "objc_autoreleasePoolPop");
assert(objc_autoreleasePoolPop != NULL);
}
objc_autoreleasePoolPop((void*)handle);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment