summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-13 05:14:51 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-13 05:14:51 +0000
commitd2e3c034091ce3772e9cc12d2cbb4b0fe99b25bb (patch)
tree123d8479e54f2e779f7a24e8c3b3fd3112374a14 /variable.c
parent161deb2196ecaca67d00ce64e3eb871946fab4aa (diff)
simplify some trivial rb_data_type_t callbacks
* process.c (free_exec_arg): remove (memsize_exec_arg): ptr is never NULL (exec_arg_data_type): use RUBY_TYPED_DEFAULT_FREE * variable.c (autoload_i_free): remove (autoload_data_i_type): use RUBY_TYPED_DEFAULT_FREE (autoload_memsize): ptr is never NULL * vm_backtrace.c (location_free): remove (location_mark): ptr is never NULL (location_data_type): use RUBY_TYPED_DEFAULT_FREE (backtrace_mark): ditto (backtrace_free): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/variable.c b/variable.c
index 64a0556..b32a6ff 100644
--- a/variable.c
+++ b/variable.c
@@ -1543,7 +1543,7 @@ static size_t
autoload_memsize(const void *ptr)
{
const st_table *tbl = ptr;
- return tbl ? st_memsize(tbl) : 0;
+ return st_memsize(tbl);
}
static const rb_data_type_t autoload_data_type = {
@@ -1584,13 +1584,6 @@ autoload_i_mark(void *ptr)
rb_gc_mark(p->value);
}
-static void
-autoload_i_free(void *ptr)
-{
- struct autoload_data_i *p = ptr;
- xfree(p);
-}
-
static size_t
autoload_i_memsize(const void *ptr)
{
@@ -1599,7 +1592,7 @@ autoload_i_memsize(const void *ptr)
static const rb_data_type_t autoload_data_i_type = {
"autoload_i",
- {autoload_i_mark, autoload_i_free, autoload_i_memsize,},
+ {autoload_i_mark, RUBY_TYPED_DEFAULT_FREE, autoload_i_memsize,},
NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};