Skip to content

Commit 6a6bdfb

Browse files
committed
wip
1 parent 7c42a29 commit 6a6bdfb

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

ext/datadog_profiling_native_extension/profiling.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ static VALUE _native_enforce_success(DDTRACE_UNUSED VALUE _self, VALUE syserr_er
4141
static void *trigger_enforce_success(void *trigger_args);
4242
static VALUE _native_malloc_stats(DDTRACE_UNUSED VALUE _self);
4343
static VALUE _native_safe_object_info(DDTRACE_UNUSED VALUE _self, VALUE obj);
44-
static VALUE _native_raise_native_error_with_invalid_class(DDTRACE_UNUSED VALUE _self, VALUE invalid_exception_class, VALUE message, VALUE telemetry_message);
4544

4645
void DDTRACE_EXPORT Init_datadog_profiling_native_extension(void) {
4746
// The profiler still has a lot of limitations around being used in Ractors BUT for now we're choosing to take care of those
@@ -90,7 +89,6 @@ void DDTRACE_EXPORT Init_datadog_profiling_native_extension(void) {
9089
rb_define_singleton_method(testing_module, "_native_enforce_success", _native_enforce_success, 2);
9190
rb_define_singleton_method(testing_module, "_native_malloc_stats", _native_malloc_stats, 0);
9291
rb_define_singleton_method(testing_module, "_native_safe_object_info", _native_safe_object_info, 1);
93-
rb_define_singleton_method(testing_module, "_native_raise_native_error_with_invalid_class", _native_raise_native_error_with_invalid_class, 3);
9492
}
9593

9694
static VALUE native_working_p(DDTRACE_UNUSED VALUE _self) {
@@ -289,13 +287,3 @@ static VALUE _native_malloc_stats(DDTRACE_UNUSED VALUE _self) {
289287
static VALUE _native_safe_object_info(DDTRACE_UNUSED VALUE _self, VALUE obj) {
290288
return rb_str_new_cstr(safe_object_info(obj));
291289
}
292-
293-
// Allows testing raise_error with an unrecognized exception class
294-
// TODO: REMOVE THIS UNUSED METHOD
295-
static VALUE _native_raise_native_error_with_invalid_class(DDTRACE_UNUSED VALUE _self, VALUE invalid_exception_class, VALUE message, VALUE telemetry_message) {
296-
ENFORCE_TYPE(message, T_STRING);
297-
ENFORCE_TYPE(telemetry_message, T_STRING);
298-
299-
VALUE exception = rb_exc_new_cstr(invalid_exception_class, StringValueCStr(message));
300-
private_raise_exception(exception, StringValueCStr(message), StringValueCStr(telemetry_message));
301-
}

ext/datadog_profiling_native_extension/ruby_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void ruby_helpers_init(void) {
4040
// Make sure to *not* invoke Ruby code as this function can run in unsafe contexts.
4141
// NOTE: Raising the exception acquires the GVL (unsafe), but it also aborts the current execution flow.
4242
// @see debug_enter_unsafe_context
43-
void private_raise_exception(VALUE exception, const char *detailed_message, const char *static_message) {
43+
static void private_raise_exception(VALUE exception, const char *detailed_message, const char *static_message) {
4444
rb_ivar_set(exception, telemetry_message_id, rb_str_new_cstr(static_message));
4545
rb_exc_raise(exception);
4646
}

ext/datadog_profiling_native_extension/ruby_helpers.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ NORETURN(
7070
__attribute__ ((format (printf, 3, 4)));
7171
);
7272

73-
// NOTE: Only used externally for testing
74-
// TODO: unexpose this.
75-
NORETURN(
76-
void private_raise_exception(VALUE exception, const char *detailed_message, const char *static_message)
77-
);
73+
7874

7975
#define ENFORCE_SUCCESS_GVL(expression) ENFORCE_SUCCESS_HELPER(expression, true)
8076
#define ENFORCE_SUCCESS_NO_GVL(expression) ENFORCE_SUCCESS_HELPER(expression, false)

0 commit comments

Comments
 (0)