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

ruby-changes:29191

From: nobu <ko1@a...>
Date: Wed, 12 Jun 2013 12:00:42 +0900 (JST)
Subject: [ruby-changes:29191] nobu:r41243 (trunk): array.c: assertion

nobu	2013-06-12 12:00:17 +0900 (Wed, 12 Jun 2013)

  New Revision: 41243

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

  Log:
    array.c: assertion
    
    * array.c (ary_shrink_capa): additional assertion.

  Modified files:
    trunk/array.c

Index: array.c
===================================================================
--- array.c	(revision 41242)
+++ array.c	(revision 41243)
@@ -179,11 +179,12 @@ ary_resize_capa(VALUE ary, long capacity https://github.com/ruby/ruby/blob/trunk/array.c#L179
     }
 }
 
-static void
+static inline void
 ary_shrink_capa(VALUE ary)
 {
     long capacity = ARY_HEAP_LEN(ary);
     long old_capa = RARRAY(ary)->as.heap.aux.capa;
+    assert(!ARY_SHARED_P(ary));
     assert(old_capa >= capacity);
     if (old_capa > capacity)
 	REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, capacity);

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

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