aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authorJean Boussier <byroot@ruby-lang.org>2023-11-22 15:23:02 +0100
committerJean Boussier <jean.boussier@gmail.com>2023-11-22 18:42:04 +0100
commitc8d99fa662e459f678e0dd12a2d954a20cc1a97e (patch)
treee156ea33df3c851304cc4ca2c424e059732271a3 /thread.c
parent295d648f766d46c5da059dac26b0373f986b6a28 (diff)
downloadruby-c8d99fa662e459f678e0dd12a2d954a20cc1a97e.tar.gz
Embed ThreadGroup object
These are rare but embedding them is trivial and make them fit in a 40B slot.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/thread.c b/thread.c
index 094ff5c77f..6c255ae159 100644
--- a/thread.c
+++ b/thread.c
@@ -4693,16 +4693,14 @@ struct thgroup {
int enclosed;
};
-static size_t
-thgroup_memsize(const void *ptr)
-{
- return sizeof(struct thgroup);
-}
-
static const rb_data_type_t thgroup_data_type = {
"thgroup",
- {0, RUBY_TYPED_DEFAULT_FREE, thgroup_memsize,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
+ {
+ 0,
+ RUBY_TYPED_DEFAULT_FREE,
+ NULL, // No external memory to report
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_EMBEDDABLE
};
/*