X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fscheme%2Fao_scheme_mem.c;fp=src%2Fscheme%2Fao_scheme_mem.c;h=94275451b10419fefbaa4e0e3be317a47b9e0752;hb=6593570418e087b9f83ed7f90303d4e1e7d20e83;hp=3659d3ec4a7fa331312bc96f856183c071c148aa;hpb=9f1849e548e35498f88a0b8adbbc4a57c7a39222;p=fw%2Faltos diff --git a/src/scheme/ao_scheme_mem.c b/src/scheme/ao_scheme_mem.c index 3659d3ec..94275451 100644 --- a/src/scheme/ao_scheme_mem.c +++ b/src/scheme/ao_scheme_mem.c @@ -623,6 +623,20 @@ ao_scheme_collect(uint8_t style) top += size; } + /* Short-circuit the rest of the loop when all of the + * found objects aren't moving. This isn't strictly + * necessary as the rest of the loop is structured to + * work in this case, but GCC 7.2.0 with optimization + * greater than 2 generates incorrect code for this... + */ + if (i == AO_SCHEME_NCHUNK) { + chunk_low = chunk_high; +#if DBG_MEM_STATS + loops++; +#endif + continue; + } + /* * Limit amount of chunk array used in mapping moves * to the active region