Fix heap corruption and verification.

There was a faulty assumption that space End() was always aligned to
card boundaries. This was true for all spaces other than the image
and resulted in heap corruption when the last object of the image
space contained a reference to an object in another space.

Also fixed an error where we called the pre GC verification post GC.

Bug: 17080623

(cherry picked from commit 6724d8649ab73e4fb86c8014bda51b13bddf2f3f)

Change-Id: I931149421c738653863eb6105dfdf7ecd750601a
2 files changed