Mark cached pid if necessary

This commit is contained in:
Nobuyoshi Nakada 2023-03-20 18:08:05 +09:00
parent 1aa2555044
commit 758e4db551
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -514,8 +514,8 @@ clear_pid_cache(void)
static inline void
rb_process_atfork(void)
{
clear_pid_cache();
rb_thread_atfork(); /* calls mjit_resume() */
clear_pid_cache();
rb_thread_atfork(); /* calls mjit_resume() */
}
/*
@ -9055,5 +9055,10 @@ Init_process(void)
#endif
define_id(hertz);
/* pid_t must be signed, since fork() can return -1 */
const rb_pid_t half_max_pidt = (rb_pid_t)1 << (sizeof(rb_pid_t) * CHAR_BIT - 2);
const rb_pid_t max_pidt = 2 * (half_max_pidt - 1) + 1;
if (!POSFIXABLE(max_pidt)) rb_gc_register_address(&cached_pid);
InitVM(process);
}