1
0
Fork 0

visual studio

This commit is contained in:
Jan Steemann 2016-08-02 11:46:44 +02:00
parent 04a1be577f
commit 2870a9f10f
3 changed files with 12 additions and 5 deletions

View File

@ -60,7 +60,7 @@ void V8PlatformFeature::collectOptions(
options->addHiddenOption("--javascript.v8-options", "options to pass to v8",
new VectorParameter<StringParameter>(&_v8Options));
options->addOption("--javascript.v8-max-heap", "maximal heap size",
options->addOption("--javascript.v8-max-heap", "maximal heap size (in MB)",
new UInt64Parameter(&_v8MaxHeap));
}
@ -75,6 +75,13 @@ void V8PlatformFeature::validateOptions(
exit(EXIT_SUCCESS);
}
}
if (0 < _v8MaxHeap) {
if (_v8MaxHeap > (std::numeric_limits<int>::max)()) {
LOG(FATAL) << "value for '--javascript.v8-max-heap' exceeds maximum value " << (std::numeric_limits<int>::max)();
FATAL_ERROR_EXIT();
}
}
}
void V8PlatformFeature::start() {
@ -160,7 +167,7 @@ v8::Isolate* V8PlatformFeature::createIsolate() {
createParams.array_buffer_allocator = _allocator.get();
if (0 < _v8MaxHeap) {
createParams.constraints.set_max_old_space_size(_v8MaxHeap);
createParams.constraints.set_max_old_space_size(static_cast<int>(_v8MaxHeap));
}
auto isolate = v8::Isolate::New(createParams);

View File

@ -26,7 +26,7 @@
namespace {
template <typename DurationT, typename ReprT = typename DurationT::rep>
constexpr DurationT maxDuration() noexcept {
return DurationT{std::numeric_limits<ReprT>::max()};
return DurationT{(std::numeric_limits<ReprT>::max)()};
}
template <typename DurationT>

View File

@ -170,7 +170,7 @@ class HybridLogicalClock {
static signed char decodeTable[256];
};
};
};
}
}
#endif