mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-05-16 14:28:31 +00:00
Move lambda to static function
This commit is contained in:
parent
c3e8405020
commit
a0f13ab49f
@ -216,10 +216,15 @@ DCL_HOOK_FUNC(static int, pthread_attr_destroy, void *target) {
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
static size_t get_fd_max() {
|
||||
rlimit r{32768, 32768};
|
||||
getrlimit(RLIMIT_NOFILE, &r);
|
||||
return r.rlim_max;
|
||||
}
|
||||
|
||||
ZygiskContext::ZygiskContext(JNIEnv *env, void *args) :
|
||||
env(env), args{args}, process(nullptr), pid(-1), flags(0), info_flags(0),
|
||||
allowed_fds([] static { rlimit r{32768, 32768}; getrlimit(RLIMIT_NOFILE, &r); return r.rlim_max; }()),
|
||||
hook_info_lock(PTHREAD_MUTEX_INITIALIZER) { g_ctx = this; }
|
||||
allowed_fds(get_fd_max()), hook_info_lock(PTHREAD_MUTEX_INITIALIZER) { g_ctx = this; }
|
||||
|
||||
ZygiskContext::~ZygiskContext() {
|
||||
// This global pointer points to a variable on the stack.
|
||||
|
Loading…
x
Reference in New Issue
Block a user