mirror of
https://github.com/phpv8/v8js.git
synced 2025-01-03 09:21:51 +00:00
Use V8::LowMemoryNotification on V8 < 3.28.36
This commit is contained in:
parent
97ade17ef9
commit
3dca462e9d
@ -45,7 +45,11 @@ static void v8js_timer_interrupt_handler(v8::Isolate *isolate, void *data) { /*
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
if (send_notification) {
|
if (send_notification) {
|
||||||
|
#if PHP_V8_API_VERSION >= 3028036
|
||||||
isolate->LowMemoryNotification();
|
isolate->LowMemoryNotification();
|
||||||
|
#else
|
||||||
|
v8::V8::LowMemoryNotification();
|
||||||
|
#endif
|
||||||
has_sent_notification = true;
|
has_sent_notification = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,11 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
|
|||||||
isolate->GetHeapStatistics(&hs);
|
isolate->GetHeapStatistics(&hs);
|
||||||
|
|
||||||
if (hs.used_heap_size() > memory_limit) {
|
if (hs.used_heap_size() > memory_limit) {
|
||||||
|
#if PHP_V8_API_VERSION >= 3028036
|
||||||
isolate->LowMemoryNotification();
|
isolate->LowMemoryNotification();
|
||||||
|
#else
|
||||||
|
v8::V8::LowMemoryNotification();
|
||||||
|
#endif
|
||||||
isolate->GetHeapStatistics(&hs);
|
isolate->GetHeapStatistics(&hs);
|
||||||
|
|
||||||
if (hs.used_heap_size() > memory_limit) {
|
if (hs.used_heap_size() > memory_limit) {
|
||||||
|
Loading…
Reference in New Issue
Block a user