< prev index next >

src/hotspot/share/gc/shared/cardTable.hpp

Print this page
@@ -186,11 +186,11 @@
    HeapWord* addr_for(const CardValue* p) const {
      assert(p >= _byte_map && p < _byte_map + _byte_map_size,
             "out of bounds access to card marking array. p: " PTR_FORMAT
             " _byte_map: " PTR_FORMAT " _byte_map + _byte_map_size: " PTR_FORMAT,
             p2i(p), p2i(_byte_map), p2i(_byte_map + _byte_map_size));
-     size_t delta = pointer_delta(p, _byte_map_base, sizeof(CardValue));
+     size_t delta =  (((uintptr_t) p) - ((uintptr_t) _byte_map_base)) / sizeof(CardValue);
      HeapWord* result = (HeapWord*) (delta << card_shift);
      assert(_whole_heap.contains(result),
             "Returning result = " PTR_FORMAT " out of bounds of "
             " card marking array's _whole_heap = [" PTR_FORMAT "," PTR_FORMAT ")",
             p2i(result), p2i(_whole_heap.start()), p2i(_whole_heap.end()));
< prev index next >