summaryrefslogtreecommitdiff
path: root/ext/-test-/random/loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/-test-/random/loop.c')
-rw-r--r--ext/-test-/random/loop.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/-test-/random/loop.c b/ext/-test-/random/loop.c
index 0572096403..f79e5cfd83 100644
--- a/ext/-test-/random/loop.c
+++ b/ext/-test-/random/loop.c
@@ -13,6 +13,16 @@ static const rb_random_interface_t random_loop_if = {
RB_RANDOM_INTERFACE_DEFINE_WITH_REAL(loop)
};
+static void
+loop_free(void *ptr)
+{
+ rand_loop_t *r = ptr;
+
+ xfree(r->buf);
+ xfree(r);
+}
+
+RB_RANDOM_DEFINE_INIT_INT32_FUNC(loop)
static size_t
random_loop_memsize(const void *ptr)
{
@@ -24,7 +34,7 @@ static rb_random_data_type_t random_loop_type = {
"random/loop",
{
rb_random_mark,
- RUBY_TYPED_DEFAULT_FREE,
+ loop_free,
random_loop_memsize,
},
RB_RANDOM_PARENT,