LibGfx: Make Gfx::Bitmap::set_nonvolatile() report allocation failure

Making a bitmap non-volatile after being volatile may fail to allocate
physical pages after the kernel stole the old pages in a purge.

This is different from the pages being purged, but reallocated. In that
case, they are simply replaced with zero-fill-on-demand pages as if
they were freshly allocated.
This commit is contained in:
Andreas Kling 2021-07-24 22:49:48 +02:00
commit 143443e0b6
Notes: sideshowbarker 2024-07-18 08:22:11 +09:00
23 changed files with 57 additions and 46 deletions

View file

@ -1367,11 +1367,11 @@ void BMPImageDecoderPlugin::set_volatile()
m_context->bitmap->set_volatile();
}
bool BMPImageDecoderPlugin::set_nonvolatile()
bool BMPImageDecoderPlugin::set_nonvolatile(bool& was_purged)
{
if (!m_context->bitmap)
return false;
return m_context->bitmap->set_nonvolatile();
return m_context->bitmap->set_nonvolatile(was_purged);
}
bool BMPImageDecoderPlugin::sniff()