From 3dca462e9d0279f0dedbb0fb8e20f761f64465e4 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Sat, 26 Mar 2016 14:11:20 +0100 Subject: [PATCH] Use V8::LowMemoryNotification on V8 < 3.28.36 --- v8js_timer.cc | 4 ++++ v8js_v8.cc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/v8js_timer.cc b/v8js_timer.cc index a3ae679..cb678f1 100644 --- a/v8js_timer.cc +++ b/v8js_timer.cc @@ -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; } diff --git a/v8js_v8.cc b/v8js_v8.cc index 1ab13ab..8d53665 100644 --- a/v8js_v8.cc +++ b/v8js_v8.cc @@ -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) {