mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
8037295: Add size_t versions of Atomic::add, dec, and inc
Reviewed-by: dholmes, fparain
This commit is contained in:
parent
f190cc8c67
commit
91dcc35215
3 changed files with 26 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2014, 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
|
||||
|
@ -57,6 +57,7 @@ class Atomic : AllStatic {
|
|||
|
||||
// Atomically add to a location, return updated value
|
||||
inline static jint add (jint add_value, volatile jint* dest);
|
||||
inline static size_t add (size_t add_value, volatile size_t* dest);
|
||||
inline static intptr_t add_ptr(intptr_t add_value, volatile intptr_t* dest);
|
||||
inline static void* add_ptr(intptr_t add_value, volatile void* dest);
|
||||
// See comment above about using jlong atomics on 32-bit platforms
|
||||
|
@ -65,12 +66,14 @@ class Atomic : AllStatic {
|
|||
// Atomically increment location
|
||||
inline static void inc (volatile jint* dest);
|
||||
static void inc (volatile jshort* dest);
|
||||
inline static void inc (volatile size_t* dest);
|
||||
inline static void inc_ptr(volatile intptr_t* dest);
|
||||
inline static void inc_ptr(volatile void* dest);
|
||||
|
||||
// Atomically decrement a location
|
||||
inline static void dec (volatile jint* dest);
|
||||
static void dec (volatile jshort* dest);
|
||||
inline static void dec (volatile size_t* dest);
|
||||
inline static void dec_ptr(volatile intptr_t* dest);
|
||||
inline static void dec_ptr(volatile void* dest);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue