Skip to content

Commit

Permalink
Re-added reset var.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustaf Sjoberg committed Sep 22, 2016
1 parent 1eb14d7 commit 54e0037
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions c_src/erlang_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ size_t PacketLength() {
bool NextPacket(Packet* packet) {
size_t len = PacketLength();
uint32_t ref = 0;
uint32_t timeout = 0;

if (len == 0) {
return false;
Expand Down Expand Up @@ -80,9 +79,10 @@ bool NextPacket(Packet* packet) {
bool CommandLoop(VM& vm) {
HandleScope handle_scope(vm.GetIsolate());

bool reset = false;
Packet packet;

while (NextPacket(&packet)) {
while (!reset && NextPacket(&packet)) {
TRACE("In command loop!\n");
vm.Size();

Expand All @@ -103,16 +103,16 @@ bool CommandLoop(VM& vm) {
FTRACE("Destroying context: %i\n", packet.ref);
vm.DestroyContext(packet.ref);
break;
case OP_RESET_VM:
FTRACE("Ignoring reset: %i\n", packet.ref);
// reset = true;
break;
}

// TODO: Move inside VM-handler?
vm.PumpMessageLoop();

packet = (const Packet){ 0 };
}
Isolate::GetCurrent()->ContextDisposedNotification();

return true;
return reset;
}

int main(int argc, char* argv[]) {
Expand Down
1 change: 1 addition & 0 deletions c_src/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const uint8_t OP_EVAL = 1;
const uint8_t OP_CALL = 2;
const uint8_t OP_CREATE_CONTEXT = 3;
const uint8_t OP_DESTROY_CONTEXT = 4;
const uint8_t OP_RESET_VM = 5;

struct Packet {
uint8_t op;
Expand Down

0 comments on commit 54e0037

Please sign in to comment.