Created
April 14, 2015 14:33
-
-
Save ojacobson/53ed91d919d5d71d5cf2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Loads a class, convert the '.' to '/'. | |
*/ | |
static jclass | |
LoadClass(JNIEnv *env, char *name) | |
{ | |
char *buf = MemAlloc(strlen(name) + 1); | |
char *s = buf, *t = name, c; | |
jclass cls; | |
jlong start, end; | |
if (_launcher_debug) | |
start = CounterGet(); | |
do { | |
c = *t++; | |
*s++ = (c == '.') ? '/' : c; | |
} while (c != '\0'); | |
cls = (*env)->FindClass(env, buf); | |
free(buf); | |
if (_launcher_debug) { | |
end = CounterGet(); | |
printf("%ld micro seconds to load main class\n", | |
(long)(jint)Counter2Micros(end-start)); | |
printf("----_JAVA_LAUNCHER_DEBUG----\n"); | |
} | |
return cls; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment