mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-12-01 18:15:41 +00:00
TimingEvents: Avoid heap allocation in SortEvents()
This commit is contained in:
parent
022b2fc013
commit
b4136d2834
|
@ -1,13 +1,17 @@
|
||||||
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
|
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
|
||||||
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
||||||
|
|
||||||
#include "timing_event.h"
|
#include "timing_event.h"
|
||||||
#include "common/assert.h"
|
|
||||||
#include "common/log.h"
|
|
||||||
#include "cpu_core.h"
|
#include "cpu_core.h"
|
||||||
#include "cpu_core_private.h"
|
#include "cpu_core_private.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#include "util/state_wrapper.h"
|
#include "util/state_wrapper.h"
|
||||||
|
|
||||||
|
#include "common/assert.h"
|
||||||
|
#include "common/log.h"
|
||||||
|
#include "common/thirdparty/SmallVector.h"
|
||||||
|
|
||||||
Log_SetChannel(TimingEvents);
|
Log_SetChannel(TimingEvents);
|
||||||
|
|
||||||
namespace TimingEvents {
|
namespace TimingEvents {
|
||||||
|
@ -248,7 +252,7 @@ void TimingEvents::RemoveActiveEvent(TimingEvent* event)
|
||||||
|
|
||||||
void TimingEvents::SortEvents()
|
void TimingEvents::SortEvents()
|
||||||
{
|
{
|
||||||
std::vector<TimingEvent*> events;
|
llvm::SmallVector<TimingEvent*, 16> events;
|
||||||
events.reserve(s_state.active_event_count);
|
events.reserve(s_state.active_event_count);
|
||||||
|
|
||||||
TimingEvent* next = s_state.active_events_head;
|
TimingEvent* next = s_state.active_events_head;
|
||||||
|
|
Loading…
Reference in a new issue