Weaver: group allocations together

This commit is contained in:
vis2k 2021-08-20 14:34:49 +08:00
parent 4ad2af4f74
commit 71eb7cb91d

View File

@ -140,13 +140,9 @@ public static bool Weave(AssemblyDefinition asmDef)
weaverTypes = new WeaverTypes(CurrentAssembly, Log);
CreateGeneratedCodeClass();
// WeaverList depends on WeaverTypes setup because it uses Import
weaverLists = new WeaverLists();
System.Diagnostics.Stopwatch rwstopwatch = System.Diagnostics.Stopwatch.StartNew();
// initialize readers & writers with this assembly.
// we need to do this in every Process() call.
// otherwise we would get
@ -155,6 +151,9 @@ public static bool Weave(AssemblyDefinition asmDef)
writers = new Writers(CurrentAssembly, weaverTypes, Log);
readers = new Readers(CurrentAssembly, weaverTypes, Log);
CreateGeneratedCodeClass();
System.Diagnostics.Stopwatch rwstopwatch = System.Diagnostics.Stopwatch.StartNew();
// Need to track modified from ReaderWriterProcessor too because it could find custom read/write functions or create functions for NetworkMessages
bool modified = ReaderWriterProcessor.Process(CurrentAssembly, writers, readers);
rwstopwatch.Stop();