Commit b6911b55 authored by erikcorry's avatar erikcorry

A version of test-api.cc that compiles both on Mac and on Linux.

Review URL: http://codereview.chromium.org/10050013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11275 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 983d521f
......@@ -10865,14 +10865,18 @@ THREADED_TEST(NestedHandleScopeAndContexts) {
}
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));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment