aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authorAdam Hess <adamhess1991@gmail.com>2023-10-12 11:15:53 -0700
committerPeter Zhu <peter@peterzhu.ca>2023-12-07 15:52:35 -0500
commit6816e8efcff3be75f8020cd1b0ea57d3cd664bbc (patch)
tree8f8484b955ba25e9df6a2038db0f156e7cbf71e4 /cont.c
parentb361a800c22e0248bf126d77e96a7bd4f9c34d1b (diff)
downloadruby-6816e8efcff3be75f8020cd1b0ea57d3cd664bbc.tar.gz
Free everything at shutdown
when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Peter Zhu <peter@peterzhu.ca>
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cont.c b/cont.c
index 6bafc07ca8..88c726927c 100644
--- a/cont.c
+++ b/cont.c
@@ -275,6 +275,12 @@ struct rb_fiber_struct {
static struct fiber_pool shared_fiber_pool = {NULL, NULL, 0, 0, 0, 0};
+void
+rb_free_shared_fiber_pool(void)
+{
+ xfree(shared_fiber_pool.allocations);
+}
+
static ID fiber_initialize_keywords[3] = {0};
/*