------extPart_001_0001_01C0B7D6.18833430
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I worked fine on my win2K with SP1 and latest cygwin, with ruby 1.6.2



----- Original Message -----
From: Dave Thomas
Sent: Wednesday, March 28, 2001 4:54 PM
To: ruby-talk / ruby-lang.org
Subject: [ruby-talk:13289] Re: This is going to sound crazy, but...


matz / zetabits.com (Yukihiro Matsumoto) writes:

> |If anyone's interested, Andy has isolated this down to about 30 lines
> |of code (10 lines of Ruby, and 20 lines of C extension). But before we
> |inflict this puzzler on anyone else, we were wondering if anyone had
> |seem similar problems under 2000.
>
> Show me the code.  It might not be a Win 2000 problem, but GC problem
> which happen to be hidden on other architectures.  It sometimes happens.

The following blows up under 2000, but runs fine on all other
platforms.

There's a possibility this may be a C RTS bug: we're downloading 186Mb
of service pack right now.

Thanks


Dave



--------------------cut here-------------------------------
require "ceres"

count=0
ds = IntervalDataSet.new(30000)
while count < 30000
        puts count
        ds.value(count).to_s
        count += 1
        GC.start
end
puts "Exit Normal"

--------------------cut here-------------------------------

#include "ruby.h"

static VALUE cIntervalDataSet;

typedef struct {
  int           size;
} IDS_Struct;

static VALUE ids_new(VALUE class, VALUE pcount)
{
  IDS_Struct *ids;
  VALUE me;

  ids = ALLOC(IDS_Struct);
  me = Data_Wrap_Struct(cIntervalDataSet, 0, free, ids);
  return me;
}

static VALUE ids_get_value(VALUE self, VALUE pindex)
{
  return rb_float_new(69.0);
}


void Init_ceres(void)
{
  cIntervalDataSet = rb_define_class("IntervalDataSet", rb_cObject);
  rb_define_singleton_method(cIntervalDataSet, "new", ids_new, 1);
  rb_define_method(cIntervalDataSet, "value", ids_get_value, 1);
}<br clear=all><hr>Get your FREE download of MSN Explorer at http://explorer.msn.com<br></p>

------extPart_001_0001_01C0B7D6.18833430
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<HTML><BODY STYLE="font:10pt verdana; border:none;"><DIV>I worked fine on my win2K with SP1 and latest cygwin, with ruby 1.6.2<BR></DIV> <DIV><BR></DIV> <BLOCKQUOTE style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"> <DIV style="FONT: 10pt Arial">----- Original Message -----</DIV> <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt Arial; FONT-COLOR: black"><B>From:</B>&nbsp;Dave Thomas</DIV> <DIV style="FONT: 10pt Arial"><B>Sent:</B>&nbsp;Wednesday, March 28, 2001 4:54 PM</DIV> <DIV style="FONT: 10pt Arial"><B>To:</B>&nbsp;ruby-talk / ruby-lang.org</DIV> <DIV style="FONT: 10pt Arial"><B>Subject:</B>&nbsp;[ruby-talk:13289] Re: This is going to sound crazy, but...</DIV> <DIV><BR></DIV>matz / zetabits.com (Yukihiro Matsumoto) writes:<BR><BR>&gt; |If anyone's interested, Andy has isolated this down to about 30 lines<BR>&gt; |of code (10 lines of Ruby, and 20 lines of C extension). But before we<BR>&gt; |inflict this puzzler on anyone else, we were wondering if anyone had<BR>&gt; |seem similar problems under 2000.<BR>&gt;<BR>&gt; Show me the code.&nbsp; It might not be a Win 2000 problem, but GC problem<BR>&gt; which happen to be hidden on other architectures.&nbsp; It sometimes happens.<BR><BR>The following blows up under 2000, butuns fine on all other<BR>platforms.<BR><BR>There's a possibility this may be a C RTS bug: we're downloading 186Mb<BR>of service pack right now.<BR><BR>Thanks<BR><BR><BR>Dave<BR><BR><BR><BR>--------------------cut here-------------------------------<BR>require "ceres"<BR><BR>count=0<BR>ds3D IntervalDataSet.new(30000)<BR>while count &lt; 30000<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; puts count<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ds.value(count).to_s<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count += 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GC.start<BR>end<BR>puts "Exit Normal"<BR><BR>--------------------cut here-------------------------------<BR><BR>#include "ruby.h"<BR><BR>static VALUE cIntervalDataSet;<BR><BR>typedef struct {<BR>&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size;<BR>} IDS_Struct;<BR><BR>static VALUE ids_new(VALUE class, VALUE pcount)<BR>{<BR>&nbsp; IDS_Struct *ids;<BR>&nbsp; VALUE me;<BR><BR>&nbsp; ids = ALLOC(IDS_Struct);<BR>&nbsp; me = Data_Wrap_Struct(cIntervalDataSet, 0, free, ids);<BR>&nbsp; return me;<BR>}<BR><BR>static VALUE ids_get_value(VALUE self, VALUE pindex)<BR>{<BR>&nbsp; return rb_float_new(69.0);<BR>}<BR><BR><BR>void Init_ceres(void)<BR>{<BR>&nbsp; cIntervalDataSet = rb_define_class("IntervalDataSet", rb_cObject);<BR>&nbsp; rb_define_singleton_method(cIntervalDataSet,new", ids_new, 1);<BR>&nbsp; rb_define_method(cIntervalDataSet, "value", ids_get_value, 1);<BR>}<BR> <DIV></DIV></BLOCKQUOTE></BODY></HTML><DIV><BR><br clear=all><hr>Get your FREE download of MSN Explorer at http://explorer.msn.com<br></p></DIV>

------extPart_001_0001_01C0B7D6.18833430--