[macruby-changes] [4026] MacRuby/trunk/gc.c

source_changes at macosforge.org source_changes at macosforge.org
Wed May 5 18:48:28 PDT 2010


Revision: 4026
          http://trac.macosforge.org/projects/ruby/changeset/4026
Author:   lsansonetti at apple.com
Date:     2010-05-05 18:48:25 -0700 (Wed, 05 May 2010)
Log Message:
-----------
xmalloc must be called with a size > 0

Modified Paths:
--------------
    MacRuby/trunk/gc.c

Modified: MacRuby/trunk/gc.c
===================================================================
--- MacRuby/trunk/gc.c	2010-05-05 20:06:11 UTC (rev 4025)
+++ MacRuby/trunk/gc.c	2010-05-06 01:48:25 UTC (rev 4026)
@@ -110,12 +110,7 @@
 static inline void *
 ruby_xmalloc_memory(size_t size, int type)
 {
-    if (size < 0) {
-	rb_raise(rb_eNoMemError, "negative allocation size (or too big)");
-    }
-    if (size == 0) {
-	size = 1;
-    }
+    assert(size > 0);
     if (__auto_zone == NULL) {
 	rb_objc_no_gc_error();
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100505/dcf5be7d/attachment.html>


More information about the macruby-changes mailing list