summaryrefslogtreecommitdiff
path: root/process.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 /process.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 'process.c')
-rw-r--r--process.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/process.c b/process.c
index 590a21f..c4965ec 100644
--- a/process.c
+++ b/process.c
@@ -1348,21 +1348,15 @@ mark_exec_arg(void *ptr)
rb_gc_mark(eargp->chdir_dir);
}
-static void
-free_exec_arg(void *ptr)
-{
- xfree(ptr);
-}
-
static size_t
memsize_exec_arg(const void *ptr)
{
- return ptr ? sizeof(struct rb_execarg) : 0;
+ return sizeof(struct rb_execarg);
}
static const rb_data_type_t exec_arg_data_type = {
"exec_arg",
- {mark_exec_arg, free_exec_arg, memsize_exec_arg},
+ {mark_exec_arg, RUBY_TYPED_DEFAULT_FREE, memsize_exec_arg},
NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};