Fix two problems in mark & sweep GC.
commitc30ee2656adc3ba725baf6f37461a79dda765f9d
authorDouglas Katzman <dougk@google.com>
Sat, 10 Dec 2016 15:44:09 +0000 (10 10:44 -0500)
committerDouglas Katzman <dougk@google.com>
Sat, 10 Dec 2016 15:52:09 +0000 (10 10:52 -0500)
tree9cdd693a43dc253d913319bc3db8cc874ea73383
parent84b723e8c4bd309a58dc8e677f9c6f59ea326dce
Fix two problems in mark & sweep GC.

- Fencepost bug in computing 'max_used_varyobj_page' if the final page
  has no object header on it (so its generation mask is 0).

- Flip the order of operations in the page fault handler.
  In the order as it was, if GC happened in between setting the dirty bit
  and making a page writable, then the GC might simply clear the bit,
  as no write has actually occurred yet, only to resume at the system call
  which unprotects the page. This made a writable page not marked dirty.
src/runtime/marknsweepgc.c