ruby/test/objspace
nagachika 141402d11c merge revision(s) e1bd45624c: [Backport #19482]
Fix crash when allocating classes with newobj hook

	We need to zero out the whole slot when running the newobj hook for a
	newly allocated class because the slot could be filled with garbage,
	which would cause a crash if a GC runs inside of the newobj hook.

	For example, the following script crashes:

	```
	require "objspace"

	GC.stress = true

	ObjectSpace.trace_object_allocations {
	  100.times do
	    Class.new
	  end
	}
	```

	[Bug #19482]
	---
	 gc.c                           | 8 +++++++-
	 test/objspace/test_objspace.rb | 7 +++++++
	 2 files changed, 14 insertions(+), 1 deletion(-)
2023-07-16 12:58:21 +09:00
..
test_objspace.rb merge revision(s) e1bd45624c: [Backport #19482] 2023-07-16 12:58:21 +09:00
test_ractor.rb merge revision(s) 7bd7aee02e: [Backport #18464] 2023-06-25 15:20:43 +09:00