Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes compilation for node 0.6.x

  • Loading branch information...
commit c2d80c1c3bc58b8c1d7ca7d04cfabb983948df60 1 parent d2999f3
Camilo Aguilar authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 graph_node.cc
12 graph_node.cc
View
@@ -1,5 +1,6 @@
#include "graph_node.h"
#include "graph_edge.h"
+#include "node_version.h"
using namespace v8;
@@ -124,9 +125,20 @@ Handle<Value> GraphNode::GetChild(const Arguments& args) {
Handle<Value> GraphNode::GetRetainedSize(const Arguments& args) {
HandleScope scope;
+
Handle<Object> self = args.This();
void* ptr = self->GetPointerFromInternalField(0);
+
+#if NODE_VERSION_AT_LEAST(0, 7, 0)
int32_t size = static_cast<HeapGraphNode*>(ptr)->GetRetainedSize();
+#else
+ bool exact = false;
+ if (args.Length() > 0) {
+ exact = args[0]->BooleanValue();
+ }
+ int32_t size = static_cast<HeapGraphNode*>(ptr)->GetRetainedSize(exact);
+#endif
+
return scope.Close(Integer::New(size));
}
Please sign in to comment.
Something went wrong with that request. Please try again.