From c8d99fa662e459f678e0dd12a2d954a20cc1a97e Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Wed, 22 Nov 2023 15:23:02 +0100 Subject: Embed ThreadGroup object These are rare but embedding them is trivial and make them fit in a 40B slot. --- thread.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'thread.c') 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 }; /* -- cgit v1.2.3