2011-04-13 16:20:48 -05:00
|
|
|
#ifndef _RR_V8_WEAKREF_
|
|
|
|
#define _RR_V8_WEAKREF_
|
|
|
|
|
|
|
|
#include <v8.h>
|
|
|
|
#include "ruby.h"
|
2011-04-19 10:42:57 -05:00
|
|
|
#include "ruby/version.h"
|
2011-04-13 16:20:48 -05:00
|
|
|
|
|
|
|
struct v8_weakref {
|
|
|
|
v8_weakref(VALUE object);
|
|
|
|
VALUE get();
|
|
|
|
void set(VALUE object);
|
|
|
|
void retain();
|
|
|
|
void release();
|
|
|
|
|
|
|
|
VALUE object_id;
|
|
|
|
v8::Persistent<v8::External> external;
|
|
|
|
};
|
|
|
|
|
2011-04-15 08:43:06 -05:00
|
|
|
void v8_weakref_dispose(v8::Persistent<v8::Value> value, void* weakref);
|
|
|
|
VALUE v8_weakref_finalize(VALUE self, VALUE object_id);
|
|
|
|
VALUE v8_weakref_objectspace();
|
2011-04-13 16:20:48 -05:00
|
|
|
VALUE v8_weakref_nil(VALUE nil, VALUE exception);
|
|
|
|
VALUE v8_weakref_id2ref(VALUE id);
|
|
|
|
|
2011-04-19 10:42:57 -05:00
|
|
|
|
|
|
|
#if RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR == 8
|
2011-04-21 13:15:34 -05:00
|
|
|
extern "C" VALUE rb_proc_new(VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE);
|
2011-04-19 10:42:57 -05:00
|
|
|
#endif
|
|
|
|
|
2011-04-13 16:20:48 -05:00
|
|
|
#endif
|