diff --git a/ext/dl/doc/dl.txt b/ext/dl/doc/dl.txt index 44499bba15..51da92c49d 100644 --- a/ext/dl/doc/dl.txt +++ b/ext/dl/doc/dl.txt @@ -174,7 +174,7 @@ the class Handle keeps a handle to opened library. == PtrData class -* ptr = PtrData.new(addr, [free = nil]) +* ptr = PtrData.new(addr, [size = 0, free = nil]) * returns the PtrData object representing the pointer which indicates the address addr. GC frees the memory using the free function. diff --git a/ext/dl/ptr.c b/ext/dl/ptr.c index 21a703c24e..2ad022067c 100644 --- a/ext/dl/ptr.c +++ b/ext/dl/ptr.c @@ -197,8 +197,8 @@ rb_dlptr_initialize(int argc, VALUE argv[], VALUE self) f = rb_dlsym2csym(sym); break; default: - rb_bug("rb_dlptr_s_new"); - }; + rb_bug("rb_dlptr_initialize"); + } if( p ){ Data_Get_Struct(self, struct ptr_data, data); @@ -230,8 +230,8 @@ rb_dlptr_s_malloc(int argc, VALUE argv[], VALUE klass) f = rb_dlsym2csym(sym); break; default: - rb_bug("rb_dlptr_s_new"); - }; + rb_bug("rb_dlptr_s_malloc"); + } obj = rb_dlptr_malloc(s,f);