mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
LibGfx: Nicer error reporting for bitmap allocation
This commit is contained in:
parent
52a797afdb
commit
a098046309
Notes:
sideshowbarker
2024-07-19 02:45:16 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/a098046309f Pull-request: https://github.com/SerenityOS/serenity/pull/3398 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/nico
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue