summaryrefslogtreecommitdiff
path: root/specific.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-05-25 10:12:56 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-05-25 10:12:56 +0300
commit89e66ca7e4626344b74ff848e0c307c1870201f2 (patch)
treefff52338189d69bb7f5a03776ded58fe65a2919d /specific.c
parent689b081f19739961085275ace06a82a3bf1dbe5a (diff)
downloadbdwgc-89e66ca7e4626344b74ff848e0c307c1870201f2.tar.gz
Hide value stored to thread-specific entries for a test purpose
* include/private/specific.h (ts_entry_value_t): New type. * include/private/specific.h (TS_HIDE_VALUE, TS_REVEAL_PTR): New macro. * include/private/specific.h (thread_specific_entry): Replace void* to ts_entry_value_t (for value). * include/private/specific.h (GC_getspecific): Apply TS_REVEAL_PTR to entry->value. * specific.c [USE_CUSTOM_SPECIFIC] (GC_slow_getspecific): Likewise. * specific.c [USE_CUSTOM_SPECIFIC] (GC_setspecific): Apply TS_HIDE_VALUE to value stored to entry.
Diffstat (limited to 'specific.c')
-rw-r--r--specific.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/specific.c b/specific.c
index f17d3254..624236fd 100644
--- a/specific.c
+++ b/specific.c
@@ -65,7 +65,7 @@ GC_INNER int GC_setspecific(tsd * key, void * value)
/* Could easily check for an existing entry here. */
entry -> next = key->hash[hash_val].p;
entry -> thread = self;
- entry -> value = value;
+ entry -> value = TS_HIDE_VALUE(value);
GC_ASSERT(entry -> qtid == INVALID_QTID);
/* There can only be one writer at a time, but this needs to be */
/* atomic with respect to concurrent readers. */
@@ -153,7 +153,7 @@ GC_INNER void * GC_slow_getspecific(tsd * key, word qtid,
*cache_ptr = entry;
/* Again this is safe since pointer assignments are */
/* presumed atomic, and either pointer is valid. */
- return entry -> value;
+ return TS_REVEAL_PTR(entry -> value);
}
#ifdef GC_ASSERTIONS