From 4b6c3ffe2f8bc9f4b4eb6a0909a6df6e4d996c7d Mon Sep 17 00:00:00 2001 From: anth64 Date: Thu, 9 Oct 2025 07:55:41 +0200 Subject: [PATCH] instead of storing modules as a struct, switch to a more "ECS" style of handling modules --- src/module.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/module.c b/src/module.c index 781ebf6..3e1ffe6 100644 --- a/src/module.c +++ b/src/module.c @@ -1,6 +1,9 @@ -struct module { - const char *id; - void *handle; - int (*init)(void); - int (*shutdown)(void); -}; +#include + +static void **stk_handles = NULL; +static void (**stk_inits)(void) = NULL; +static void (**stk_shutdowns)(void) = NULL; +static const char **stk_ids = NULL; + +static size_t stk_module_count = 0; +static size_t stk_module_capacity = 0;