[#7955] Failing tests in ruby since 1.8.2 — "Caleb Tennis" <caleb@...>
The following tests have been failing in Ruby for a long time, including
[#7978] Patch for Unix socket peer credentials — "James F. Hranicky" <jfh@...>
This patch adds support for getting the uid and gid of the peer
In article <200606091528.30171.jfh@cise.ufl.edu>,
On Friday 16 June 2006 11:51, Tanaka Akira wrote:
In article <200606161327.35948.jfh@cise.ufl.edu>,
On Saturday 17 June 2006 06:27, Tanaka Akira wrote:
In article <200607101352.16804.jfh@cise.ufl.edu>,
On Tuesday 11 July 2006 00:10, Tanaka Akira wrote:
Hi,
On Thursday 13 July 2006 22:48, nobu@ruby-lang.org wrote:
On Jul 18, 2006, at 12:27 PM, James F. Hranicky wrote:
On Tuesday 18 July 2006 15:52, Eric Hodel wrote:
[#7994] Ruby Kaigi date confusion — "Charles O Nutter" <headius@...>
I'm quite confused by the dates I have seen reported on various Ruby Kaigi
[#8013] Download page on ruby-lang has numeric URL — Hugh Sasse <hgs@...>
This is off-topic to ruby-core, but possibly core to ruby's uptake:
On Jun 19, 2006, at 3:32 AM, Hugh Sasse wrote:
[#8038] bug in $. ? — Wybo Dekker <wybo@...>
wybo>cat t
Wybo Dekker schrieb:
Pit Capitain wrote:
[#8050] Thank-you to the Rails Core Team — Dave Teare <devlists-ruby-core@...>
While we were listening to Dave Thomas' Keynote address today at
[#8061] Win32 Extension Issues Wanted! — "Austin Ziegler" <halostatue@...>
Everyone. I had a conversation with folks from Microsoft today about
[#8065] Core documentation patches — Alex Young <alex@...>
Hi there,
Hi,
Yukihiro Matsumoto wrote:
[#8073] 1.8.5p1 build failure on Solaris 10 — "Daniel Berger" <Daniel.Berger@...>
Solaris 10
Hi,
Yukihiro Matsumoto wrote:
>>>>> "D" == Daniel Berger <Daniel.Berger@qwest.com> writes:
ts <decoux@moulon.inra.fr> wrote on 28.06.2006 17:37:00:
Hi,
Yukihiro Matsumoto <matz@ruby-lang.org> wrote on 29.06.2006 20:02:11:
Hi,
Yukihiro Matsumoto <matz@ruby-lang.org> wrote on 29.06.2006 20:53:20:
ville.mattila@stonesoft.com wrote:
[#8087] optparse.rb to RDoc documentation patch — <noreply@...>
Patches item #4879, was opened at 2006-06-28 20:50
On Jun 28, 2006, at 11:50 AM, <noreply@rubyforge.org>
[#8102] Reorganizing configure.in by platform? — "Daniel Berger" <Daniel.Berger@...>
Hi,
Validity of local VALUEs
Hi,
I've been wondering about the lifetime of Ruby objects declared from C
functions. Assume I create a new object through the C API (say, with
rb_class_new_instance or rb_ary_new) without exporting it to Ruby or
marking it as a global with rb_global_variable. I would expect that
this object might be garbage-collected during the execution of my C
function, making the VALUE invalid. I tried to write a small test case
that caused this:
#include <ruby.h>
static VALUE a_class;
static ID a_method_ID;
static VALUE a_method(VALUE self) {
VALUE an_object;
VALUE will_i_get_this;
int i;
/* Create a Ruby object, but don't bind it anywhere */
an_object = rb_class_new_instance(0, NULL, a_class);
rb_iv_set(an_object, "@an_attribute", rb_str_new2("42"));
/* Cause some garbage collection cycles */
for (i = 0; i < 100000; i++) {
VALUE some_garbage = rb_ary_new();
rb_ary_push(some_garbage, rb_str_new2("666"));
/* Looking at the object counts, gc is really happening */
rb_eval_string("print 'objects: ', ObjectSpace.each_object {}, '\n'");
}
/* I'd expect an_object to have been collected by now */
will_i_get_this = rb_iv_get(an_object, "@an_attribute");
fprintf(stderr, "The answer is %s.\n", RSTRING(will_i_get_this)->ptr);
}
int main(int argc, char** argv) {
VALUE an_instance;
ruby_init();
a_class = rb_define_class("RubyGcTest", rb_cObject);
rb_define_method(a_class, "a_method", a_method, 0);
an_instance = rb_class_new_instance(0, NULL, a_class);
a_method_ID = rb_intern("a_method");
rb_funcall2(an_instance, a_method_ID, 0, NULL);
ruby_finalize();
return 0;
}
I would expect this to crash, but it doesn't. Looking at the object
counts returned by ObjectSpace.each_object, I can see that several gc
cycles are taking place. However, an_object is still valid by the end
of the function. Is this working "by chance"? From the observation
that I don't have 100000 array objects in the ObjectSpace after
calling rb_ary_new 100000 times, I gather that VALUEs do not remain
valid until the end of the function without being bound somewhere.
However, my calls to an_object are still returning the correct value.
Thanks in advance,
-- Hisham