Fix FieldGap priority queue ordering bug.

The priority queue for keeping track of gaps when packing fields in a
class object had the order reversed, giving priority to smaller gaps
instead of priority to larger gaps. This led to cases where fields
were not placed in gaps when they could be.

Bug: 22460222
Change-Id: I062e772e030c034adc227d75deed31c3322e203e
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 0694227..fbb2796 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -194,7 +194,9 @@
   bool operator() (const FieldGap& lhs, const FieldGap& rhs)
       NO_THREAD_SAFETY_ANALYSIS {
     // Sort by gap size, largest first. Secondary sort by starting offset.
-    return lhs.size > rhs.size || (lhs.size == rhs.size && lhs.start_offset < rhs.start_offset);
+    // Note that the priority queue returns the largest element, so operator()
+    // should return true if lhs is less than rhs.
+    return lhs.size < rhs.size || (lhs.size == rhs.size && lhs.start_offset > rhs.start_offset);
   }
 };
 typedef std::priority_queue<FieldGap, std::vector<FieldGap>, FieldGapsComparator> FieldGaps;