mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibCore: Allow posting stateless events without heap-allocated Event
This patch adds an API for posting a Core::Event::Type to the thread event queue without requiring a full Core::Event object. We use this API to avoid heap allocations for every timer and notifier activation event.
This commit is contained in:
parent
23fb9781d1
commit
69515f8c85
Notes:
github-actions[bot]
2025-12-03 12:27:51 +00:00
Author: https://github.com/awesomekling
Commit: 69515f8c85
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7004
5 changed files with 48 additions and 15 deletions
|
|
@ -210,7 +210,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
ThreadEventQueue::current().post_event(strong_owner, make<TimerEvent>());
|
||||
ThreadEventQueue::current().post_event(strong_owner, Event::Type::Timer);
|
||||
}
|
||||
|
||||
AK::Duration interval;
|
||||
|
|
@ -405,7 +405,7 @@ try_select_again:
|
|||
|
||||
#ifdef AK_OS_ANDROID
|
||||
// FIXME: Make the check work under Android, perhaps use ALooper.
|
||||
ThreadEventQueue::current().post_event(notifier, make<NotifierActivationEvent>());
|
||||
ThreadEventQueue::current().post_event(notifier, Core::Event::Type::NotifierActivation);
|
||||
#else
|
||||
auto revents = thread_data.poll_fds[i].revents;
|
||||
|
||||
|
|
@ -422,7 +422,7 @@ try_select_again:
|
|||
type &= notifier.type();
|
||||
|
||||
if (type != NotificationType::None)
|
||||
ThreadEventQueue::current().post_event(¬ifier, make<NotifierActivationEvent>());
|
||||
ThreadEventQueue::current().post_event(¬ifier, Core::Event::Type::NotifierActivation);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue