static void rb_dlmem_aset(void *ptr, VALUE obj) { if (obj == Qnil) { rb_dlmem_delete(ptr); } else{ rb_hash_aset(DLMemoryTable, DLLONG2NUM(ptr), DLLONG2NUM(obj)); } }
VALUE rb_dlhandle_to_i(VALUE self) { struct dl_handle *dlhandle; Data_Get_Struct(self, struct dl_handle, dlhandle); return DLLONG2NUM(dlhandle); }
static VALUE rb_dlmem_aref(void *ptr) { VALUE val; val = rb_hash_aref(DLMemoryTable, DLLONG2NUM(ptr)); return val == Qnil ? Qnil : (VALUE)DLNUM2LONG(val); }
static void rb_dlmem_delete(void *ptr) { rb_secure(4); rb_hash_delete(DLMemoryTable, DLLONG2NUM(ptr)); }