From: Andres Hidalgo Date: 2001-03-29T12:28:20+09:00 Subject: [ruby-talk:13306] Re: This is going to sound crazy, but... ------=_NextPart_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=3D0 ds =3D IntervalDataSet.new(30000) while count < 30000 puts count ds.value(count).to_s count +=3D 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 =3D ALLOC(IDS_Struct); me =3D 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 =3D rb_define_class("IntervalDataSet", rb_cObject); rb_define_singleton_method(cIntervalDataSet, "new", ids_new, 1); rb_define_method(cIntervalDataSet, "value", ids_get_value, 1); }

Get your FREE download of MSN Explorer at http://explorer.msn.com

------=_NextPart_001_0001_01C0B7D6.18833430 Content-Type: text/html; 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:&n= bsp;Dave Thomas
Sent: W= ednesday, March 28, 2001 4:54 PM
To: ruby-talk@ruby-lang.org
Subject: [ruby-talk:13289] Re: This is going to sound craz= y, but...

matz@zetabits.com (Yukihiro Matsumoto) wri= tes:

> |If anyone's interested, Andy has isolated this down to = about 30 lines
> |of code (10 lines of Ruby, and 20 lines of C exte= nsion). But before we
> |inflict this puzzler on anyone else, we we= re 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.&= nbsp; It sometimes happens.

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

There's a possibility this m= ay be a C RTS bug: we're downloading 186Mb
of service pack right now.<= BR>
Thanks


Dave



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

count=3D0
ds= =3D IntervalDataSet.new(30000)
while count < 30000
  =       puts count
    &nbs= p;   ds.value(count).to_s
     &nbs= p;  count +=3D 1
        GC.st= art
end
puts "Exit Normal"

--------------------cut here-----= --------------------------

#include "ruby.h"

static VALUE c= IntervalDataSet;

typedef struct {
  int   &= nbsp;       size;
} IDS_Struct;

s= tatic VALUE ids_new(VALUE class, VALUE pcount)
{
  IDS_Struct = *ids;
  VALUE me;

  ids =3D ALLOC(IDS_Struct);
&nb= sp; me =3D Data_Wrap_Struct(cIntervalDataSet, 0, free, ids);
  re= turn me;
}

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


void Init_cere= s(void)
{
  cIntervalDataSet =3D rb_define_class("IntervalData= Set", rb_cObject);
  rb_define_singleton_method(cIntervalDataSet,= "new", ids_new, 1);
  rb_define_method(cIntervalDataSet, "value"= , ids_get_value, 1);
}
=


Get your FREE download of MSN Explorer at http://explorer.msn.com

------=_NextPart_001_0001_01C0B7D6.18833430--