diff --git a/gc.c b/gc.c index 04df9dc71b..2b363ac7d0 100644 --- a/gc.c +++ b/gc.c @@ -1910,6 +1910,11 @@ rb_objspace_alloc(void) rb_darray_make_without_gc(&objspace->weak_references, 0); + // TODO: debug why on Windows Ruby crashes on boot when GC is on. +#ifdef _WIN32 + dont_gc_on(); +#endif + return objspace; } diff --git a/vm.c b/vm.c index c9d99a34ea..36f6700ad7 100644 --- a/vm.c +++ b/vm.c @@ -4198,7 +4198,9 @@ Init_VM(void) */ rb_define_global_const("TOPLEVEL_BINDING", rb_binding_new()); +#ifdef _WIN32 rb_objspace_gc_enable(vm->objspace); +#endif } vm_init_redefined_flag();