1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

LibGfx: Nicer error reporting for bitmap allocation

This commit is contained in:
Ben Wiederhake 2020-08-30 14:19:35 +02:00 committed by Andreas Kling
parent 52a797afdb
commit a098046309

View file

@ -86,7 +86,11 @@ Bitmap::Bitmap(BitmapFormat format, const IntSize& size, Purgeable purgeable)
int map_flags = (MAP_ANONYMOUS | MAP_PRIVATE);
m_data = (RGBA32*)mmap(nullptr, size_in_bytes(), PROT_READ | PROT_WRITE, map_flags, 0, 0);
#endif
ASSERT(m_data && m_data != (void*)-1);
if (m_data == MAP_FAILED) {
perror("mmap");
ASSERT_NOT_REACHED();
}
ASSERT(m_data);
m_needs_munmap = true;
}