Fix compaction check for ObjectSpace.trace_object_allocations
We should be checking for key for moved objects rather than the value because the key is a Ruby object and the value is malloc'd memory.
This commit is contained in:
parent
39d0ebb6e8
commit
b038530506
Notes:
git
2024-12-16 15:13:14 +00:00
@ -192,9 +192,7 @@ allocation_info_tracer_memsize(const void *ptr)
|
|||||||
static int
|
static int
|
||||||
hash_foreach_should_replace_key(st_data_t key, st_data_t value, st_data_t argp, int error)
|
hash_foreach_should_replace_key(st_data_t key, st_data_t value, st_data_t argp, int error)
|
||||||
{
|
{
|
||||||
VALUE allocated_object;
|
VALUE allocated_object = (VALUE)key;
|
||||||
|
|
||||||
allocated_object = (VALUE)value;
|
|
||||||
if (allocated_object != rb_gc_location(allocated_object)) {
|
if (allocated_object != rb_gc_location(allocated_object)) {
|
||||||
return ST_REPLACE;
|
return ST_REPLACE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user