aboutsummaryrefslogtreecommitdiffstats
path: root/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index 830e66cf34..bf965b2426 100644
--- a/vm.c
+++ b/vm.c
@@ -1673,7 +1673,9 @@ vm_memsize(const void *ptr)
if (ptr) {
const rb_vm_t *vmobj = ptr;
size_t size = sizeof(rb_vm_t);
- size += st_memsize(vmobj->living_threads);
+ if (vmobj->living_threads) {
+ size += st_memsize(vmobj->living_threads);
+ }
if (vmobj->defined_strings) {
size += DEFINED_EXPR * sizeof(VALUE);
}