- reworked CVARs to not use a linked list and to be initialized manually.
This solves two problems: * The linked list is too slow, a map is better. A map cannot be used with statically allocated CVARs because order of initialization is undefined. * The current CVAR system is an unordered mishmash of static variables and dynamically allocated ones and the means of identification are unsafe. With this everything is allocated on the heap so it can all be handled the same by the cleanup code.
This commit is contained in:
parent
ef887403cf
commit
453688ccc6
28 changed files with 369 additions and 203 deletions
|
|
@ -74,6 +74,7 @@ AUTOSEG_VARIABLE(TypeInfos, AUTOSEG_CREG)
|
|||
AUTOSEG_VARIABLE(ClassFields, AUTOSEG_FREG)
|
||||
AUTOSEG_VARIABLE(Properties, AUTOSEG_GREG)
|
||||
AUTOSEG_VARIABLE(MapInfoOptions, AUTOSEG_YREG)
|
||||
AUTOSEG_VARIABLE(CVarDecl, AUTOSEG_VREG)
|
||||
|
||||
#undef AUTOSEG_VARIABLE
|
||||
#undef AUTOSEG_STOP
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@ namespace AutoSegs
|
|||
extern FAutoSeg ClassFields;
|
||||
extern FAutoSeg Properties;
|
||||
extern FAutoSeg MapInfoOptions;
|
||||
extern FAutoSeg CVarDecl;
|
||||
}
|
||||
|
||||
#define AUTOSEG_AREG areg
|
||||
|
|
@ -155,6 +156,7 @@ namespace AutoSegs
|
|||
#define AUTOSEG_FREG freg
|
||||
#define AUTOSEG_GREG greg
|
||||
#define AUTOSEG_YREG yreg
|
||||
#define AUTOSEG_VREG vreg
|
||||
|
||||
#define AUTOSEG_STR(string) AUTOSEG_STR2(string)
|
||||
#define AUTOSEG_STR2(string) #string
|
||||
|
|
@ -167,12 +169,14 @@ namespace AutoSegs
|
|||
#define SECTION_FREG AUTOSEG_MACH_SECTION(AUTOSEG_FREG)
|
||||
#define SECTION_GREG AUTOSEG_MACH_SECTION(AUTOSEG_GREG)
|
||||
#define SECTION_YREG AUTOSEG_MACH_SECTION(AUTOSEG_YREG)
|
||||
#define SECTION_VREG AUTOSEG_MACH_SECTION(AUTOSEG_VREG)
|
||||
#else
|
||||
#define SECTION_AREG AUTOSEG_STR(AUTOSEG_AREG)
|
||||
#define SECTION_CREG AUTOSEG_STR(AUTOSEG_CREG)
|
||||
#define SECTION_FREG AUTOSEG_STR(AUTOSEG_FREG)
|
||||
#define SECTION_GREG AUTOSEG_STR(AUTOSEG_GREG)
|
||||
#define SECTION_YREG AUTOSEG_STR(AUTOSEG_YREG)
|
||||
#define SECTION_VREG AUTOSEG_STR(AUTOSEG_VREG)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue