Skip to content

Commit 31573b0

Browse files
committed
fix: handle removed IdleNotificationDeadline
1 parent 5a9fcb8 commit 31573b0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

nan.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,13 @@ inline uv_loop_t* GetCurrentEventLoop() {
701701
NAN_DEPRECATED inline bool IdleNotification(int) {
702702
return true;
703703
}
704-
# elif defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
704+
#elif defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 11 || \
705+
(V8_MAJOR_VERSION == 11 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
706+
inline bool IdleNotification(int idle_time_in_ms) {
707+
v8::Isolate::GetCurrent()->MemoryPressureNotification(v8::MemoryPressureLevel::kModerate);
708+
return true;
709+
}
710+
#elif defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||
705711
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
706712
NAN_DEPRECATED inline bool IdleNotification(int idle_time_in_ms) {
707713
return v8::Isolate::GetCurrent()->IdleNotificationDeadline(

0 commit comments

Comments
 (0)