9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_SERVICES_MEM_PTR_HPP
26 #define SHARE_VM_SERVICES_MEM_PTR_HPP
27
28 #include "memory/allocation.hpp"
29 #include "runtime/atomic.hpp"
30 #include "runtime/os.hpp"
31 #include "runtime/safepoint.hpp"
32
33 /*
34 * global sequence generator that generates sequence numbers to serialize
35 * memory records.
36 */
37 class SequenceGenerator : AllStatic {
38 public:
39 static jint next();
40
41 // peek last sequence number
42 static jint peek() {
43 return _seq_number;
44 }
45
46 // reset sequence number
47 static void reset() {
48 assert(SafepointSynchronize::is_at_safepoint(), "Safepoint required");
49 _seq_number = 1;
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_SERVICES_MEM_PTR_HPP
26 #define SHARE_VM_SERVICES_MEM_PTR_HPP
27
28 #include "memory/allocation.hpp"
29 #include "runtime/os.hpp"
30 #include "runtime/safepoint.hpp"
31
32 /*
33 * global sequence generator that generates sequence numbers to serialize
34 * memory records.
35 */
36 class SequenceGenerator : AllStatic {
37 public:
38 static jint next();
39
40 // peek last sequence number
41 static jint peek() {
42 return _seq_number;
43 }
44
45 // reset sequence number
46 static void reset() {
47 assert(SafepointSynchronize::is_at_safepoint(), "Safepoint required");
48 _seq_number = 1;
|