diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-21 14:47:47 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-21 14:47:47 +0000 |
| commit | 868a02b6165bf4657e8c8729a90746eee60b5f02 (patch) | |
| tree | 81f44198eb06d434b0b770ac57cc9131e0090b2a /ext/dl/cfunc.c | |
| parent | 3a756aa2c32942b3c5dd63345f381866d87389aa (diff) | |
merges r23385 from trunk into ruby_1_9_1.
--
* ext/dl/cfunc.c (rb_dlcfunc_instance_p): new function to check if
the argument is an instance of DL::CFunc.
* ext/dl/cptr.c (rb_dlptr_initialize, rb_dlptr_s_malloc): checks
if DL::CFunc. [ruby-dev:38403].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/cfunc.c')
| -rw-r--r-- | ext/dl/cfunc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/dl/cfunc.c b/ext/dl/cfunc.c index 0ea60b197..446bc71a1 100644 --- a/ext/dl/cfunc.c +++ b/ext/dl/cfunc.c @@ -43,8 +43,9 @@ rb_dl_set_win32_last_error(VALUE self, VALUE val) void -dlcfunc_free(struct cfunc_data *data) +dlcfunc_free(void *ptr) { + struct cfunc_data *data = ptr; if( data->name ){ xfree(data->name); } @@ -107,6 +108,13 @@ rb_dlcfunc_s_allocate(VALUE klass) return obj; } +int +rb_dlcfunc_kind_p(VALUE func) +{ + if (TYPE(func) == T_DATA) return 0; + return RDATA(func)->dfree == dlcfunc_free; +} + VALUE rb_dlcfunc_initialize(int argc, VALUE argv[], VALUE self) { |
