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);
}