Skip to content

Commit

Permalink
Merge pull request #12 from eric/fix-internal-reference-alloc
Browse files Browse the repository at this point in the history
Fix Atomic::InternalReference allocation
  • Loading branch information
headius committed Feb 2, 2012
2 parents 2dc992a + a39a90e commit 04e297d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/atomic_reference.c
@@ -1,7 +1,7 @@
#include <ruby.h>

static void ir_mark(void *value) {
rb_gc_mark((VALUE)value);
rb_gc_mark_maybe((VALUE)value);
}

static VALUE ir_alloc(VALUE klass) {
Expand Down Expand Up @@ -51,7 +51,8 @@ void Init_atomic_reference() {
cAtomic = rb_const_get(rb_cObject, rb_intern("Atomic"));
cInternalReference = rb_define_class_under(cAtomic, "InternalReference",
rb_cObject);
rb_define_alloc_func(cAtomic, ir_alloc);

rb_define_alloc_func(cInternalReference, ir_alloc);

rb_define_method(cInternalReference, "initialize", ir_initialize, 1);
rb_define_method(cInternalReference, "get", ir_get, 0);
Expand Down

0 comments on commit 04e297d

Please sign in to comment.