Sha256: f6645044408194c2908c1efcaa5fd2eeda746b487f3d4fad12296b17715f8f39

Contents?: true

Size: 761 Bytes

Versions: 10

Compression:

Stored size: 761 Bytes

Contents

#pragma once

#include <datadog/profiling.h>
#include "ruby_helpers.h"

inline static ddog_CharSlice char_slice_from_ruby_string(VALUE string) {
  ENFORCE_TYPE(string, T_STRING);
  ddog_CharSlice char_slice = {.ptr = StringValuePtr(string), .len = RSTRING_LEN(string)};
  return char_slice;
}

inline static VALUE ruby_string_from_vec_u8(ddog_Vec_U8 string) {
  return rb_str_new((char *) string.ptr, string.len);
}

inline static VALUE ruby_string_from_error(const ddog_Error *error) {
  ddog_CharSlice char_slice = ddog_Error_message(error);
  return rb_str_new(char_slice.ptr, char_slice.len);
}

inline static VALUE get_error_details_and_drop(ddog_Error *error) {
  VALUE result = ruby_string_from_error(error);
  ddog_Error_drop(error);
  return result;
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ddtrace-1.14.0 ext/ddtrace_profiling_native_extension/libdatadog_helpers.h
ddtrace-1.13.1 ext/ddtrace_profiling_native_extension/libdatadog_helpers.h
ddtrace-1.13.0 ext/ddtrace_profiling_native_extension/libdatadog_helpers.h
ddtrace-1.12.1 ext/ddtrace_profiling_native_extension/libdatadog_helpers.h
ddtrace-1.12.0 ext/ddtrace_profiling_native_extension/libdatadog_helpers.h
ddtrace-1.11.1 ext/ddtrace_profiling_native_extension/libdatadog_helpers.h
ddtrace-1.11.0 ext/ddtrace_profiling_native_extension/libdatadog_helpers.h
ddtrace-1.11.0.beta1 ext/ddtrace_profiling_native_extension/libdatadog_helpers.h
ddtrace-1.10.1 ext/ddtrace_profiling_native_extension/libdatadog_helpers.h
ddtrace-1.10.0 ext/ddtrace_profiling_native_extension/libdatadog_helpers.h