summaryrefslogtreecommitdiff
path: root/thread_none.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2025-09-29 18:33:04 -0400
committerPeter Zhu <peter@peterzhu.ca>2025-09-30 09:47:29 -0400
commitd8c8623f50af8f5324e1679ff95b1a2071c0c61e (patch)
tree80610004e309fa27b673489d0b0d2001bb98ac28 /thread_none.c
parent37d65e9252a4c3096325c63a876a289e03a7417c (diff)
Set context_stack on main thread
We allocate the stack of the main thread using malloc, but we never set malloc_stack to true and context_stack. If we fork, the main thread may no longer be the main thread anymore so it reports memory being leaked in RUBY_FREE_AT_EXIT. This commit allows the main thread to free its own VM stack at shutdown.
Diffstat (limited to 'thread_none.c')
-rw-r--r--thread_none.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/thread_none.c b/thread_none.c
index 38686e17c1..e6616c0585 100644
--- a/thread_none.c
+++ b/thread_none.c
@@ -335,4 +335,10 @@ rb_thread_prevent_fork(void *(*func)(void *), void *data)
return func(data);
}
+void
+rb_thread_malloc_stack_set(rb_thread_t *th, void *stack)
+{
+ // no-op
+}
+
#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */