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

ruby-changes:44847

From: nobu <ko1@a...>
Date: Tue, 29 Nov 2016 12:06:07 +0900 (JST)
Subject: [ruby-changes:44847] nobu:r56920 (trunk): string.c: use xmalloc

nobu	2016-11-29 12:06:01 +0900 (Tue, 29 Nov 2016)

  New Revision: 56920

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

  Log:
    string.c: use xmalloc
    
    * string.c (rb_str_casemap): use xmalloc simply instead of
      ALLOC_N.

  Modified files:
    trunk/string.c
Index: string.c
===================================================================
--- string.c	(revision 56919)
+++ string.c	(revision 56920)
@@ -5923,7 +5923,7 @@ rb_str_casemap(VALUE source, OnigCaseFol https://github.com/ruby/ruby/blob/trunk/string.c#L5923
 	if (CASEMAP_DEBUG) {
 	    fprintf(stderr, "Buffer allocation, capa is %"PRIuSIZE"\n", capa); /* for tuning */
 	}
-	current_buffer->next = (mapping_buffer*)ALLOC_N(char, offsetof(mapping_buffer, space)+capa);
+	current_buffer->next = xmalloc(offsetof(mapping_buffer, space) + capa);
 	current_buffer = current_buffer->next;
 	current_buffer->next = NULL;
 	current_buffer->capa = capa;

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

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