android, desktop: set RTS options for core (#3418)
* desktop: allow settings RTS options * set initial heap and arena sizes * add non-moving GC for even more productivity/less reallocs * add RTS options for android too --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
parent
d0419df396
commit
954b7150af
@ -5,7 +5,7 @@
|
|||||||
//#include <android/log.h>
|
//#include <android/log.h>
|
||||||
|
|
||||||
// from the RTS
|
// from the RTS
|
||||||
void hs_init(int * argc, char **argv[]);
|
void hs_init_with_rtsopts(int * argc, char **argv[]);
|
||||||
|
|
||||||
// from android-support
|
// from android-support
|
||||||
void setLineBuffering(void);
|
void setLineBuffering(void);
|
||||||
@ -32,7 +32,17 @@ Java_chat_simplex_common_platform_CoreKt_pipeStdOutToSocket(JNIEnv *env, __unuse
|
|||||||
|
|
||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_chat_simplex_common_platform_CoreKt_initHS(__unused JNIEnv *env, __unused jclass clazz) {
|
Java_chat_simplex_common_platform_CoreKt_initHS(__unused JNIEnv *env, __unused jclass clazz) {
|
||||||
hs_init(NULL, NULL);
|
int argc = 5;
|
||||||
|
char *argv[] = {
|
||||||
|
"simplex",
|
||||||
|
"+RTS", // requires `hs_init_with_rtsopts`
|
||||||
|
"-A16m", // chunk size for new allocations
|
||||||
|
"-H64m", // initial heap size
|
||||||
|
"-xn", // non-moving GC
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
char **pargv = argv;
|
||||||
|
hs_init_with_rtsopts(&argc, &pargv);
|
||||||
setLineBuffering();
|
setLineBuffering();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,11 +4,14 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
// from the RTS
|
// from the RTS
|
||||||
void hs_init(int * argc, char **argv[]);
|
void hs_init_with_rtsopts(int * argc, char **argv[]);
|
||||||
|
|
||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_chat_simplex_common_platform_CoreKt_initHS(JNIEnv *env, jclass clazz) {
|
Java_chat_simplex_common_platform_CoreKt_initHS(JNIEnv *env, jclass clazz) {
|
||||||
hs_init(NULL, NULL);
|
int argc = 5;
|
||||||
|
char *argv[] = {"simplex", "+RTS", "-A16m", "-H64m", "-xn", NULL}; // see android/simplex-api.c for details
|
||||||
|
char **pargv = argv;
|
||||||
|
hs_init_with_rtsopts(&argc, &pargv);
|
||||||
}
|
}
|
||||||
|
|
||||||
// from simplex-chat
|
// from simplex-chat
|
||||||
|
Loading…
Reference in New Issue
Block a user