Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5f9e558

Browse files
authored
Forward low memory notifications from the shell to DartVM. (#14517)
1 parent 46d76eb commit 5f9e558

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

shell/common/shell.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@ Shell::~Shell() {
393393
}
394394

395395
void Shell::NotifyLowMemoryWarning() const {
396+
// This does not require a current isolate but does require a running VM.
397+
// Since a valid shell will not be returned to the embedder without a valid
398+
// DartVMRef, we can be certain that this is a safe spot to assume a VM is
399+
// running.
400+
::Dart_NotifyLowMemory();
401+
396402
task_runners_.GetGPUTaskRunner()->PostTask(
397403
[rasterizer = rasterizer_->GetWeakPtr()]() {
398404
if (rasterizer) {

0 commit comments

Comments
 (0)