[前][次][番号順一覧][スレッド一覧]

ruby-changes:40939

From: normal <ko1@a...>
Date: Thu, 10 Dec 2015 06:34:41 +0900 (JST)
Subject: [ruby-changes:40939] normal:r53018 (trunk): marshal.c: remove NULL checks for *_memsize

normal	2015-12-10 06:34:01 +0900 (Thu, 10 Dec 2015)

  New Revision: 53018

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53018

  Log:
    marshal.c: remove NULL checks for *_memsize
    
    This follows r52986, NULL checks in rb_data_type_t.function.dsize
    callbacks are unnecessary.
    
    * marshal.c (memsize_dump_arg): remove NULL check
      (memsize_load_arg): ditto

  Modified files:
    trunk/ChangeLog
    trunk/marshal.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53017)
+++ ChangeLog	(revision 53018)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Dec 10 06:33:39 2015  Eric Wong  <e@8...>
+
+	* marshal.c (memsize_dump_arg): remove NULL check
+	  (memsize_load_arg): ditto
+
 Thu Dec 10 05:53:18 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* tool/mkconfig.rb: rbconfig must not be fronzen-string-literal to
Index: marshal.c
===================================================================
--- marshal.c	(revision 53017)
+++ marshal.c	(revision 53018)
@@ -207,7 +207,7 @@ free_dump_arg(void *ptr) https://github.com/ruby/ruby/blob/trunk/marshal.c#L207
 static size_t
 memsize_dump_arg(const void *ptr)
 {
-    return ptr ? sizeof(struct dump_arg) : 0;
+    return sizeof(struct dump_arg);
 }
 
 static const rb_data_type_t dump_arg_data = {
@@ -1091,7 +1091,7 @@ free_load_arg(void *ptr) https://github.com/ruby/ruby/blob/trunk/marshal.c#L1091
 static size_t
 memsize_load_arg(const void *ptr)
 {
-    return ptr ? sizeof(struct load_arg) : 0;
+    return sizeof(struct load_arg);
 }
 
 static const rb_data_type_t load_arg_data = {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]