mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Use rb_gc_enable/rb_gc_disable_no_rest instead of ruby_disable_gc
We should use the rb_gc_enable/rb_gc_disable_no_rest APIs instead of directly setting the ruby_disable_gc variable.
This commit is contained in:
parent
d4fb966186
commit
eedb30d385
Notes:
git
2024-12-05 21:21:55 +00:00
3 changed files with 8 additions and 5 deletions
9
signal.c
9
signal.c
|
@ -751,7 +751,10 @@ rb_get_next_signal(void)
|
|||
|
||||
#if defined SIGSEGV || defined SIGBUS || defined SIGILL || defined SIGFPE
|
||||
static const char *received_signal;
|
||||
# define clear_received_signal() (void)(ruby_disable_gc = 0, received_signal = 0)
|
||||
# define clear_received_signal() do { \
|
||||
if (GET_VM() != NULL) rb_gc_enable(); \
|
||||
received_signal = 0; \
|
||||
} while (0)
|
||||
#else
|
||||
# define clear_received_signal() ((void)0)
|
||||
#endif
|
||||
|
@ -1001,7 +1004,9 @@ check_reserved_signal_(const char *name, size_t name_len, int signo)
|
|||
ruby_abort();
|
||||
}
|
||||
|
||||
ruby_disable_gc = 1;
|
||||
if (GET_VM() != NULL) {
|
||||
rb_gc_disable_no_rest();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue