Toggle main menu visibility
Main Page
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Files
File List
Globals
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
Variables
Typedefs
a
b
d
e
f
i
l
m
n
p
q
r
s
t
u
v
w
Enumerations
a
b
c
e
h
i
j
l
m
o
p
q
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
x
Macros
a
b
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
w
▼
Aerospike C Client API
Introduction
►
Data Structures
▼
Files
▼
File List
▼
aerospike
aerospike.h
►
aerospike_batch.h
►
aerospike_index.h
►
aerospike_info.h
►
aerospike_key.h
►
aerospike_query.h
►
aerospike_scan.h
►
aerospike_stats.h
►
aerospike_txn.h
►
aerospike_udf.h
►
as_address.h
►
as_admin.h
►
as_aerospike.h
►
as_arch.h
►
as_arraylist.h
►
as_arraylist_iterator.h
►
as_async.h
►
as_async_proto.h
►
as_atomic.h
►
as_atomic_gcc.h
►
as_atomic_win.h
►
as_batch.h
►
as_bin.h
►
as_bit_operations.h
►
as_boolean.h
►
as_buffer.h
►
as_buffer_pool.h
►
as_bytes.h
►
as_cdt_ctx.h
►
as_cdt_internal.h
►
as_cdt_order.h
►
as_cluster.h
►
as_command.h
►
as_config.h
►
as_conn_pool.h
►
as_cpu.h
►
as_dir.h
►
as_double.h
►
as_error.h
►
as_event.h
►
as_event_internal.h
►
as_exp.h
►
as_exp_operations.h
►
as_geojson.h
►
as_hashmap.h
►
as_hashmap_iterator.h
►
as_hll_operations.h
►
as_host.h
►
as_info.h
►
as_integer.h
►
as_iterator.h
►
as_job.h
►
as_key.h
►
as_latency.h
►
as_list.h
►
as_list_iterator.h
►
as_list_operations.h
►
as_listener.h
►
as_log.h
►
as_log_macros.h
►
as_lookup.h
►
as_map.h
►
as_map_iterator.h
►
as_map_operations.h
►
as_metrics.h
►
as_metrics_writer.h
►
as_module.h
►
as_monitor.h
►
as_msgpack.h
►
as_msgpack_ext.h
►
as_msgpack_serializer.h
►
as_nil.h
►
as_node.h
►
as_operations.h
►
as_orderedmap.h
►
as_pair.h
►
as_partition.h
►
as_partition_filter.h
►
as_partition_tracker.h
►
as_password.h
►
as_peers.h
►
as_pipe.h
►
as_policy.h
►
as_poll.h
►
as_proto.h
►
as_query.h
►
as_query_validate.h
►
as_queue.h
►
as_queue_mt.h
►
as_random.h
►
as_rec.h
►
as_record.h
►
as_record_iterator.h
►
as_result.h
►
as_scan.h
►
as_serializer.h
►
as_shm_cluster.h
►
as_sleep.h
►
as_socket.h
►
as_status.h
►
as_std.h
►
as_stream.h
►
as_string.h
►
as_string_builder.h
►
as_stringmap.h
►
as_thread.h
►
as_thread_pool.h
►
as_timer.h
►
as_tls.h
►
as_txn.h
►
as_txn_monitor.h
as_types.h
►
as_udf.h
►
as_udf_context.h
►
as_util.h
►
as_val.h
►
as_vector.h
►
ssl_util.h
►
version.h
►
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
as_atomic.h
Go to the documentation of this file.
1
/*
2
* Copyright 2008-2018 Aerospike, Inc.
3
*
4
* Portions may be licensed to Aerospike, Inc. under one or more contributor
5
* license agreements.
6
*
7
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
8
* use this file except in compliance with the License. You may obtain a copy of
9
* the License at http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
* License for the specific language governing permissions and limitations under
15
* the License.
16
*/
17
#pragma once
18
19
#if defined(_MSC_VER)
20
#include <
aerospike/as_atomic_win.h
>
21
#else
22
#include <
aerospike/as_atomic_gcc.h
>
23
#endif
24
25
/******************************************************************************
26
* LOAD
27
*****************************************************************************/
28
29
// double as_load_double(const double* target)
30
#define as_load_double(_target) ({ \
31
uint64_t v = as_load_uint64((const uint64_t*)_target); \
32
*(double*)&v; \
33
})
30
#define as_load_double(_target) ({ \
…
34
35
// float as_load_float(const float* target)
36
#define as_load_float(_target) ({ \
37
uint32_t v = as_load_uint32((const uint32_t*)_target); \
38
*(float*)&v; \
39
})
36
#define as_load_float(_target) ({ \
…
40
41
// Note - this assumes bool is implemented as a single byte.
42
// bool as_load_bool(const bool* target)
43
#define as_load_bool(_target) ({ \
44
(bool)as_load_uint8((const uint8_t*)_target); \
45
})
43
#define as_load_bool(_target) ({ \
…
46
47
// Note - this assumes bool is implemented as a single byte.
48
// bool as_load_bool_acq(const bool* target)
49
#define as_load_bool_acq(_target) ({ \
50
(bool)as_load_uint8_acq((const uint8_t*)_target); \
51
})
49
#define as_load_bool_acq(_target) ({ \
…
52
53
/******************************************************************************
54
* STORE
55
*****************************************************************************/
56
57
// void as_store_double(double* target, double value)
58
#define as_store_double(_target, _value) ({ \
59
double v = _value; \
60
as_store_uint64((uint64_t*)_target, *(uint64_t*)&v); \
61
})
58
#define as_store_double(_target, _value) ({ \
…
62
63
// void as_store_float(float* target, float value)
64
#define as_store_float(_target, _value) ({ \
65
float v = _value; \
66
as_store_uint32((uint32_t*)_target, *(uint32_t*)&v); \
67
})
64
#define as_store_float(_target, _value) ({ \
…
68
69
// Note - this assumes bool is implemented as a single byte.
70
// void as_store_bool(bool* target, bool value)
71
#define as_store_bool(_target, _value) ({ \
72
as_store_uint8((uint8_t*)_target, (uint8_t)_value); \
73
})
71
#define as_store_bool(_target, _value) ({ \
…
74
75
// Note - this assumes bool is implemented as a single byte.
76
// void as_store_bool_rls(bool* target, bool value)
77
#define as_store_bool_rls(_target, _value) ({ \
78
as_store_uint8_rls((uint8_t*)_target, (uint8_t)_value); \
79
})
77
#define as_store_bool_rls(_target, _value) ({ \
…
80
81
/******************************************************************************
82
* FETCH AND SWAP
83
*****************************************************************************/
84
85
// Note - this assumes pointers are 8 bytes.
86
// void* as_fas_ptr(void** target, void* value)
87
#define as_fas_ptr(_target, _value) ({ \
88
(void*)as_fas_uint64((uint64_t*)_target, (uint64_t)_value); \
89
})
87
#define as_fas_ptr(_target, _value) ({ \
…
90
91
// double as_fas_double(double* target, double value)
92
#define as_fas_double(_target, _value) ({ \
93
double nv = _value; \
94
uint64_t ov = as_fas_uint64((uint64_t*)_target, *(uint64_t*)&nv); \
95
*(double*)&ov; \
96
})
92
#define as_fas_double(_target, _value) ({ \
…
97
98
// float as_fas_float(float* target, float value)
99
#define as_fas_float(_target, _value) ({ \
100
float nv = _value; \
101
uint32_t ov = as_fas_uint32((uint32_t*)_target, *(uint32_t*)&nv); \
102
*(float*)&ov; \
103
})
99
#define as_fas_float(_target, _value) ({ \
…
104
105
/******************************************************************************
106
* COMPARE AND SWAP
107
*****************************************************************************/
108
109
// Note - this assumes pointers are 8 bytes.
110
// bool as_cas_ptr(void** target, void* old_value, void* new_value)
111
#define as_cas_ptr(_target, _old_value, _new_value) ({ \
112
as_cas_uint64((uint64_t*)_target, (uint64_t)_old_value, \
113
(uint64_t)_new_value); \
114
})
111
#define as_cas_ptr(_target, _old_value, _new_value) ({ \
…
115
116
// bool as_cas_double(double* target, double old_value, double new_value)
117
#define as_cas_double(_target, _old_value, _new_value) ({ \
118
double ov = _old_value; \
119
double nv = _new_value; \
120
as_cas_uint64((uint64_t*)_target, *(uint64_t*)&ov, *(uint64_t*)&nv); \
121
})
117
#define as_cas_double(_target, _old_value, _new_value) ({ \
…
122
123
// bool as_cas_float(float* target, float old_value, float new_value)
124
#define as_cas_float(_target, _old_value, _new_value) ({ \
125
float ov = _old_value; \
126
float nv = _new_value; \
127
as_cas_uint32((uint32_t*)_target, *(uint32_t*)&ov, *(uint32_t*)&nv); \
128
})
124
#define as_cas_float(_target, _old_value, _new_value) ({ \
…
as_atomic_gcc.h
as_atomic_win.h
aerospike
as_atomic.h
Generated on Tue Apr 1 2025 17:42:44 for Aerospike C Client API by
1.10.0