[macruby-changes] [3642] MacRuby/branches/icu/re.cpp

source_changes at macosforge.org source_changes at macosforge.org
Fri Feb 26 18:41:35 PST 2010


Revision: 3642
          http://trac.macosforge.org/projects/ruby/changeset/3642
Author:   lsansonetti at apple.com
Date:     2010-02-26 18:41:34 -0800 (Fri, 26 Feb 2010)
Log Message:
-----------
do not reuse busy match objects

Modified Paths:
--------------
    MacRuby/branches/icu/re.cpp

Modified: MacRuby/branches/icu/re.cpp
===================================================================
--- MacRuby/branches/icu/re.cpp	2010-02-27 02:29:44 UTC (rev 3641)
+++ MacRuby/branches/icu/re.cpp	2010-02-27 02:41:34 UTC (rev 3642)
@@ -37,6 +37,7 @@
 } rb_match_t;
 
 #define RMATCH(o) ((rb_match_t *)o)
+#define MATCH_BUSY FL_USER2
 
 static rb_regexp_t *
 regexp_alloc(VALUE klass, SEL sel)
@@ -446,7 +447,7 @@
     delete matcher;
 
     VALUE match = rb_backref_get();
-    if (NIL_P(match)) {
+    if (NIL_P(match) || FL_TEST(match, MATCH_BUSY)) {
 	match = (VALUE)match_alloc(rb_cMatch, 0);
 	rb_backref_set(match);
     }
@@ -1536,7 +1537,7 @@
 void
 rb_match_busy(VALUE match)
 {
-    // Do nothing.
+    FL_SET(match, MATCH_BUSY);
 }
 
 } // extern "C"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100226/f50a449f/attachment-0001.html>


More information about the macruby-changes mailing list