summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-20 11:30:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-20 11:30:13 +0000
commit85ce703fabc94df19aedf130baad81cb4870fa88 (patch)
treeef105fa1c2e025ab18dcf7be8859e8575a690525 /ext
parent3780ede6ef2248effe7f1725cbab052391aefd3f (diff)
ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/dbm/dbm.c8
-rw-r--r--ext/sdbm/init.c8
2 files changed, 6 insertions, 10 deletions
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 88c4233..c3102de 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -65,14 +65,12 @@ fdbm_close(obj)
}
static VALUE
-fdbm_s_new(argc, argv, klass)
+fdbm_alloc(argc, argv, klass)
int argc;
VALUE *argv;
VALUE klass;
{
- VALUE obj = Data_Wrap_Struct(klass, 0, free_dbm, 0);
- rb_obj_call_init(obj, argc, argv);
- return obj;
+ return Data_Wrap_Struct(klass, 0, free_dbm, 0);
}
static VALUE
@@ -720,7 +718,7 @@ Init_dbm()
rb_eDBMError = rb_define_class("DBMError", rb_eStandardError);
rb_include_module(rb_cDBM, rb_mEnumerable);
- rb_define_singleton_method(rb_cDBM, "new", fdbm_s_new, -1);
+ rb_define_alloc_func(rb_cDBM, fdbm_alloc);
rb_define_singleton_method(rb_cDBM, "open", fdbm_s_open, -1);
rb_define_method(rb_cDBM, "initialize", fdbm_initialize, -1);
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index 99945d3..81dc59a 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -57,14 +57,12 @@ fsdbm_close(obj)
}
static VALUE
-fsdbm_s_new(argc, argv, klass)
+fsdbm_alloc(argc, argv, klass)
int argc;
VALUE *argv;
VALUE klass;
{
- VALUE obj = Data_Wrap_Struct(klass, 0, free_sdbm, 0);
- rb_obj_call_init(obj, argc, argv);
- return obj;
+ return Data_Wrap_Struct(klass, 0, free_sdbm, 0);
}
static VALUE
@@ -719,7 +717,7 @@ Init_sdbm()
rb_eDBMError = rb_define_class("SDBMError", rb_eStandardError);
rb_include_module(rb_cDBM, rb_mEnumerable);
- rb_define_singleton_method(rb_cDBM, "new", fsdbm_s_new, -1);
+ rb_define_alloc_func(rb_cDBM, fsdbm_alloc);
rb_define_singleton_method(rb_cDBM, "open", fsdbm_s_open, -1);
rb_define_method(rb_cDBM, "initialize", fsdbm_initialize, -1);