< prev index next >

src/share/vm/gc/g1/g1HotCardCache.cpp

Print this page
rev 13453 : imported patch Atomic_add

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -62,11 +62,11 @@
     // The card is not hot so do not store it in the cache;
     // return it for immediate refining.
     return card_ptr;
   }
   // Otherwise, the card is hot.
-  size_t index = Atomic::add(1, &_hot_cache_idx) - 1;
+  size_t index = Atomic::add(1u, &_hot_cache_idx) - 1;
   size_t masked_index = index & (_hot_cache_size - 1);
   jbyte* current_ptr = _hot_cache[masked_index];
 
   // Try to store the new card pointer into the cache. Compare-and-swap to guard
   // against the unlikely event of a race resulting in another card pointer to
< prev index next >