1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00

Context#Dispose() is not a thing in v8 4.5

This commit is contained in:
Charles Lowell 2015-07-05 11:49:26 -05:00
parent 1fac021d91
commit b8ba4c422a
4 changed files with 3553 additions and 13 deletions

View file

@ -6,10 +6,8 @@ namespace rr {
ClassBuilder("Context").
defineSingletonMethod("New", &New).
defineMethod("Dispose", &Dispose).
defineMethod("Enter", &Enter).
defineMethod("Exit", &Exit).
defineMethod("Global", &Global).
store(&Class);
@ -37,11 +35,6 @@ namespace rr {
));
}
VALUE Context::Dispose(VALUE self) {
Context(self).dispose();
return Qnil;
}
VALUE Context::Enter(VALUE self) {
Context context(self);
Locker lock(context.getIsolate());

View file

@ -8,11 +8,8 @@ namespace rr {
static void Init();
static VALUE New(int argc, VALUE argv[], VALUE self);
static VALUE Dispose(VALUE self);
static VALUE Enter(VALUE self);
static VALUE Exit(VALUE self);
static VALUE Global(VALUE self);
// TODO

View file

@ -2,6 +2,10 @@
#ifndef RR_ISOLATE
#define RR_ISOLATE
#include "vendor/concurrentqueue.h"
using namespace moodycamel;
namespace rr {
/**
* V8::C::Isolate
@ -21,7 +25,7 @@ namespace rr {
*/
class Isolate : public Pointer<v8::Isolate> {
public:
class IsolateData;
struct IsolateData;
static void Init();
static VALUE New(VALUE self);
@ -48,10 +52,14 @@ namespace rr {
return (IsolateData*)pointer->GetData(0);
}
inline void scheduleDelete(v8::Global<void>* cell) {
data()->queue.enqueue(cell);
}
static VALUE Dispose(VALUE self);
class IsolateData {
struct IsolateData {
ConcurrentQueue<v8::Global<void>*> queue;
};
};
}

3542
ext/v8/vendor/concurrentqueue.h vendored Normal file

File diff suppressed because it is too large Load diff