In Files

  • dl/dl.c

Parent

Methods

String

Public Instance Methods

to_ptr() click to toggle source
 
               VALUE
rb_str_to_ptr(VALUE self)
{
  char *ptr;
  int  len;
  VALUE p;

  len = RSTRING(self)->len;
  ptr = (char*)dlmalloc(len + 1);
  memcpy(ptr, RSTRING(self)->ptr, len);
  ptr[len] = '\0';
  p = rb_dlptr_new((void*)ptr,len,dlfree);
  OBJ_INFECT(p, self);
  return p;
}