}
+static int64_t cast(intptr_t x) { return static_cast<int64_t>(x); }
+
+
THREADED_TEST(ExternalAllocatedMemory) {
v8::HandleScope outer;
v8::Persistent<Context> env(Context::New());
CHECK(!env.IsEmpty());
const intptr_t kSize = 1024*1024;
- CHECK_EQ(v8::V8::AdjustAmountOfExternalAllocatedMemory(kSize), kSize);
- CHECK_EQ(v8::V8::AdjustAmountOfExternalAllocatedMemory(-kSize),
- static_cast<intptr_t>(0));
+ CHECK_EQ(cast(v8::V8::AdjustAmountOfExternalAllocatedMemory(kSize)),
+ cast(kSize));
+ CHECK_EQ(cast(v8::V8::AdjustAmountOfExternalAllocatedMemory(-kSize)),
+ cast(0));
}