summaryrefslogtreecommitdiff
path: root/src/KingSystem/ActorSystem/actAiQueries.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2021-01-01 19:08:49 +0100
committerLéo Lam <leo@leolam.fr>2021-01-01 19:10:46 +0100
commit117e6891b02a9487488ead012fc6216a40316c44 (patch)
tree61236fd904f40641d15becb43c2eaa6eb89d2c9f /src/KingSystem/ActorSystem/actAiQueries.cpp
parentcb33d236a3286ef5660a712b4b065d413e41f21f (diff)
Reduce code size by avoiding static inline member variables
Static inline member variables require the compiler to emit a static runtime constructor in all translation units that can see the variables in question. This normally wouldn't be a problem, but it gets expensive really quickly when you have ~3000 classes and ~3000 duplicate static constructors. This drops the ELF size from ~270MB to ~220MB and probably speeds up builds a little bit.
Diffstat (limited to 'src/KingSystem/ActorSystem/actAiQueries.cpp')
-rw-r--r--src/KingSystem/ActorSystem/actAiQueries.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/KingSystem/ActorSystem/actAiQueries.cpp b/src/KingSystem/ActorSystem/actAiQueries.cpp
index 5d900bcc..ac5e03a6 100644
--- a/src/KingSystem/ActorSystem/actAiQueries.cpp
+++ b/src/KingSystem/ActorSystem/actAiQueries.cpp
@@ -140,4 +140,6 @@ void Queries::setFactories(int count, QueryFactory* factories) {
sFactories.setBuffer(count, factories);
}
+sead::Buffer<QueryFactory> Queries::sFactories;
+
} // namespace ksys::act::ai