0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-09-19 01:35:18 +00:00

Use V8::LowMemoryNotification on V8 < 3.28.36

This commit is contained in:
Stefan Siegl 2016-03-26 14:11:20 +01:00
parent 97ade17ef9
commit 3dca462e9d
2 changed files with 8 additions and 0 deletions

View File

@ -45,7 +45,11 @@ static void v8js_timer_interrupt_handler(v8::Isolate *isolate, void *data) { /*
do {
if (send_notification) {
#if PHP_V8_API_VERSION >= 3028036
isolate->LowMemoryNotification();
#else
v8::V8::LowMemoryNotification();
#endif
has_sent_notification = true;
}

View File

@ -210,7 +210,11 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
isolate->GetHeapStatistics(&hs);
if (hs.used_heap_size() > memory_limit) {
#if PHP_V8_API_VERSION >= 3028036
isolate->LowMemoryNotification();
#else
v8::V8::LowMemoryNotification();
#endif
isolate->GetHeapStatistics(&hs);
if (hs.used_heap_size() > memory_limit) {