module Kernel

Public Instance Methods

srn_dst(p1, p2) click to toggle source
VALUE _srn_dst(VALUE self, VALUE s1, VALUE s2) {
  VALUE ret;
  float d;
  void **ptr = malloc(sizeof(void *) * 3);
  ptr[0] = (void *)StringValueCStr(s1);
  ptr[1] = (void *)StringValueCStr(s2);
  ptr[2] = (void *)&d;
  rb_thread_call_without_gvl(srn_dst_wrap, ptr, NULL, NULL);
  // d = srn_dst(StringValueCStr(s1), StringValueCStr(s2));
  ret = rb_float_new(d);
  free(ptr);
  return ret;
}