aboutsummaryrefslogtreecommitdiffstats
path: root/core/context.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-08 11:53:51 -0800
committerChris Robinson <[email protected]>2023-12-08 11:53:51 -0800
commit112ad405df27b5a20d7a578321b592be2d4d8eaf (patch)
treea3401c88cdcd70dee030697cec885adfc6330d57 /core/context.h
parent040c172cdf186c9ccfb0642aa9ac598f115bb46b (diff)
Use a fixed array for fixed-size clusters
Diffstat (limited to 'core/context.h')
-rw-r--r--core/context.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/context.h b/core/context.h
index fded0902..e2a62a53 100644
--- a/core/context.h
+++ b/core/context.h
@@ -143,20 +143,19 @@ struct ContextBase {
* However, to avoid allocating each object individually, they're allocated
* in clusters that are stored in a vector for easy automatic cleanup.
*/
- using VoiceChangeCluster = std::unique_ptr<VoiceChange[]>;
+ using VoiceChangeCluster = std::unique_ptr<std::array<VoiceChange,128>>;
std::vector<VoiceChangeCluster> mVoiceChangeClusters;
- using VoiceCluster = std::unique_ptr<Voice[]>;
+ using VoiceCluster = std::unique_ptr<std::array<Voice,32>>;
std::vector<VoiceCluster> mVoiceClusters;
- using VoicePropsCluster = std::unique_ptr<VoicePropsItem[]>;
+ using VoicePropsCluster = std::unique_ptr<std::array<VoicePropsItem,32>>;
std::vector<VoicePropsCluster> mVoicePropClusters;
- static constexpr size_t EffectSlotClusterSize{4};
EffectSlot *getEffectSlot();
- using EffectSlotCluster = std::unique_ptr<EffectSlot[]>;
+ using EffectSlotCluster = std::unique_ptr<std::array<EffectSlot,4>>;
std::vector<EffectSlotCluster> mEffectSlotClusters;