1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:27:35 +00:00

AK: Make Bitmap construction OOM-fallible

This commit is contained in:
Idan Horowitz 2022-02-10 18:53:26 +02:00
parent 1667a80ade
commit 871a53db76
6 changed files with 44 additions and 32 deletions

View file

@ -47,7 +47,7 @@ public:
void will_track_seen_events(size_t profile_event_count)
{
if (m_seen_events.size() != profile_event_count)
m_seen_events = Bitmap { profile_event_count, false };
m_seen_events = Bitmap::must_create(profile_event_count, false);
}
bool has_seen_event(size_t event_index) const { return m_seen_events.get(event_index); }
void did_see_event(size_t event_index) { m_seen_events.set(event_index, true); }