File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 64
64
#include "utils_assert.h"
65
65
#include "utils_common.h"
66
66
#include "utils_concurrency.h"
67
+ #include "utils_sanitizers.h"
67
68
68
69
/*
69
70
* A node that has been deleted is left untouched for this many delete
@@ -137,10 +138,12 @@ struct critnib {
137
138
* atomic load
138
139
*/
139
140
static void load (void * src , void * dst ) {
141
+ utils_annotate_acquire (src );
140
142
util_atomic_load_acquire ((word * )src , (word * )dst );
141
143
}
142
144
143
145
static void load64 (uint64_t * src , uint64_t * dst ) {
146
+ utils_annotate_acquire ((void * )src );
144
147
util_atomic_load_acquire (src , dst );
145
148
}
146
149
@@ -149,6 +152,7 @@ static void load64(uint64_t *src, uint64_t *dst) {
149
152
*/
150
153
static void store (void * dst , void * src ) {
151
154
util_atomic_store_release ((word * )dst , (word )src );
155
+ utils_annotate_release (dst );
152
156
}
153
157
154
158
/*
Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ extern "C" {
113
113
static inline void utils_annotate_acquire (void * ptr ) {
114
114
#if __SANITIZE_THREAD__
115
115
__tsan_acquire (ptr );
116
+ #elif UMF_VG_HELGRIND_ENABLED || UMF_VG_DRD_ENABLED
117
+ ANNOTATE_HAPPENS_AFTER (ptr );
116
118
#else
117
119
(void )ptr ;
118
120
#endif
@@ -121,6 +123,8 @@ static inline void utils_annotate_acquire(void *ptr) {
121
123
static inline void utils_annotate_release (void * ptr ) {
122
124
#if __SANITIZE_THREAD__
123
125
__tsan_release (ptr );
126
+ #elif UMF_VG_HELGRIND_ENABLED || UMF_VG_DRD_ENABLED
127
+ ANNOTATE_HAPPENS_BEFORE (ptr );
124
128
#else
125
129
(void )ptr ;
126
130
#endif
You can’t perform that action at this time.
0 commit comments