Skip to content

Commit 7f87912

Browse files
nobudenofevil
authored andcommitted
check typed data with the current thread.
1 parent 9f7ab93 commit 7f87912

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ext/ruby_debug/ruby_debug.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,19 @@ context_thread_0(debug_context_t *debug_context)
191191
return id2ref(debug_context->thread_id);
192192
}
193193

194+
static inline const rb_data_type_t *
195+
threadptr_data_type(void)
196+
{
197+
static const rb_data_type_t *thread_data_type;
198+
if (!thread_data_type) {
199+
VALUE current_thread = rb_thread_current();
200+
thread_data_type = RTYPEDDATA_TYPE(current_thread);
201+
}
202+
return thread_data_type;
203+
}
204+
205+
#define ruby_threadptr_data_type *threadptr_data_type()
206+
194207
static int
195208
is_in_locked(VALUE thread_id)
196209
{

0 commit comments

Comments
 (0)