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

ruby-changes:7916

From: naruse <ko1@a...>
Date: Sun, 21 Sep 2008 02:55:07 +0900 (JST)
Subject: [ruby-changes:7916] Ruby:r19437 (trunk): * ext/json/ext/parser/parse.c: use ruby_xfree().

naruse	2008-09-21 02:54:46 +0900 (Sun, 21 Sep 2008)

  New Revision: 19437

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

  Log:
    * ext/json/ext/parser/parse.c: use ruby_xfree().
    
    * ext/json/ext/parser/parse.rl: ditto.
    
    * ext/json/ext/parser/unicode.c: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/ext/json/ext/parser/parser.c
    trunk/ext/json/ext/parser/parser.rl
    trunk/ext/json/ext/parser/unicode.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19436)
+++ ChangeLog	(revision 19437)
@@ -1,3 +1,11 @@
+Sun Sep 21 02:48:45 2008  NARUSE, Yui  <naruse@r...>
+
+	* ext/json/ext/parser/parse.c: use ruby_xfree().
+
+	* ext/json/ext/parser/parse.rl: ditto.
+
+	* ext/json/ext/parser/unicode.c: ditto.
+
 Sun Sep 21 02:40:20 2008  NARUSE, Yui  <naruse@r...>
 
 	* ext/json: import JSON v 1.1.3.
Index: ext/json/ext/parser/unicode.c
===================================================================
--- ext/json/ext/parser/unicode.c	(revision 19436)
+++ ext/json/ext/parser/unicode.c	(revision 19437)
@@ -103,12 +103,12 @@
                         + (ch2 - UNI_SUR_LOW_START) + halfBase;
                     ++tmpPtr;
                 } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
-                    free(tmp);
+                    ruby_xfree(tmp);
                     rb_raise(rb_path2class("JSON::ParserError"),
                             "source sequence is illegal/malformed near %s", source);
                 }
             } else { /* We don't have the 16 bits following the high surrogate. */
-                free(tmp);
+                ruby_xfree(tmp);
                 rb_raise(rb_path2class("JSON::ParserError"),
                     "partial character in source, but hit end near %s", source);
                 break;
@@ -116,7 +116,7 @@
         } else if (flags == strictConversion) {
             /* UTF-16 surrogate values are illegal in UTF-32 */
             if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
-                free(tmp);
+                ruby_xfree(tmp);
                 rb_raise(rb_path2class("JSON::ParserError"),
                     "source sequence is illegal/malformed near %s", source);
             }
@@ -148,7 +148,7 @@
         }
         rb_str_buf_cat(buffer, p, bytesToWrite);
     }
-    free(tmp);
+    ruby_xfree(tmp);
     source += 5 + (n - 1) * 6;
     return source;
 }
Index: ext/json/ext/parser/parser.rl
===================================================================
--- ext/json/ext/parser/parser.rl	(revision 19436)
+++ ext/json/ext/parser/parser.rl	(revision 19437)
@@ -588,7 +588,7 @@
 
 static void JSON_free(JSON_Parser *json)
 {
-    free(json);
+    ruby_xfree(json);
 }
 
 static VALUE cJSON_parser_s_allocate(VALUE klass)
Index: ext/json/ext/parser/parser.c
===================================================================
--- ext/json/ext/parser/parser.c	(revision 19436)
+++ ext/json/ext/parser/parser.c	(revision 19437)
@@ -1708,7 +1708,7 @@
 
 static void JSON_free(JSON_Parser *json)
 {
-    free(json);
+    ruby_xfree(json);
 }
 
 static VALUE cJSON_parser_s_allocate(VALUE klass)

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

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