# HG changeset patch # User Matti Hamalainen # Date 1588000391 -10800 # Node ID b9734859db5cceb64e20d1aebf0ef701661d2d62 # Parent e2e94f9afe1b293f9aef4adde4507ae49a646936 Add few comments about the state of jssOptimizeModule(). diff -r e2e94f9afe1b -r b9734859db5c tools/xm2jss.c --- a/tools/xm2jss.c Mon Apr 27 18:08:39 2020 +0300 +++ b/tools/xm2jss.c Mon Apr 27 18:13:11 2020 +0300 @@ -915,7 +915,14 @@ } -/* Optimize a given module +/* Optimize a given module. + * NOTE! While this function creates and returns a new JSSModule, + * it mostly copies references to data in the source module, + * AND also modifies the source module - which is kinda "bad". + * If/when freeing module data, you MUST only jssFreeModule() + * the source one, and dmFree() the optimized result. + * + * This should be re-written to copy the data instead. */ JSSModule *jssOptimizeModule(JSSModule *src) { @@ -1096,6 +1103,9 @@ if (usedInstruments[ninst]) { JSSInstrument *ip; + + // XXX TODO instrument stripping should be done here + // if this ever gets rewritten to copy source data instead. if (optStripInstr) continue; @@ -1141,6 +1151,8 @@ { JSSExtInstrument *eip; + // XXX TODO instrument stripping should be done here + // if this ever gets rewritten to copy source data instead. if (optStripExtInstr) continue;