Skip to content

Commit b045835

Browse files
committed
Add pretty name for T_IMEMO VM objects
These show up from time to time and will be user-visible, so it's nice to have a name for them. We could consider hiding them, but my thinking is: what if there's something in the user's code that causes a lot of them to be created? That seems relevant to report on, even if they are VM objects, since the user will probably want to change their code to avoid this.
1 parent 4a7115d commit b045835

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/ddtrace_profiling_native_extension/collectors_thread_context.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1143,9 +1143,10 @@ void thread_context_collector_sample_allocation(VALUE self_instance, unsigned in
11431143
// Fallback for objects with no class
11441144
class_name = ruby_value_type_to_class_name(type);
11451145
}
1146+
} else if (type == RUBY_T_IMEMO) {
1147+
class_name = DDOG_CHARSLICE_C("(VM Internal, T_IMEMO)");
11461148
} else {
1147-
class_name = ruby_vm_type; // For internal things and, we just use the VM type
1148-
// TODO: Maybe prefix them with a nice note? E.g. (VM Internal, T_IMEMO)
1149+
class_name = ruby_vm_type; // For other weird internal things we just use the VM type
11491150
}
11501151
}
11511152

0 commit comments

Comments
 (0)