Use AoS for modules instead of SoA

This commit is contained in:
2025-04-18 14:39:09 +03:00
parent dcf863bf26
commit 09d5020494
5 changed files with 70 additions and 91 deletions

View File

@@ -8,24 +8,22 @@
struct HiloadContext;
sc_array_def(uptr, uptr);
enum HiModuleState {
HI_MODULE_STATE_CLEAN = 0,
HI_MODULE_STATE_DIRTY,
};
typedef struct {
struct sc_array_str names; // Array of library names
struct sc_array_ptr handles; // Array of library handles
struct sc_array_uptr addresses; // Array of library base addresses
struct sc_array_syms symbols; // Symbol info for modules
u8 state[256]; // Flag for when module needs to be changed
size_t count; // Number of modules
} ModuleInfos;
const char *name; // Filename if found
uptr address;
u8 state;
} HiModuleData;
sc_array_def(HiModuleData, module);
typedef struct sc_array_module HiModuleArray;
HiloadResult moduler_reload(HiModuleData *module,
const struct sc_array_memreg *const memregs);
HiloadResult moduler_reload(ModuleInfos *modinfos,
const struct sc_array_memreg *const memregs,
int modindex);
#endif // MODULER_H_