summaryrefslogtreecommitdiffstats
path: root/vespamalloc
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-04-19 18:46:59 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-04-19 18:46:59 +0000
commitaa70ed3fa69fa0393e21945adeec56314619536b (patch)
tree492f1ec7fabe7518957c307a9025266f84ae1b37 /vespamalloc
parent499c47d54b37b067e764821e232f78ab643a5b98 (diff)
Add comment about shortcut.
Diffstat (limited to 'vespamalloc')
-rw-r--r--vespamalloc/src/vespamalloc/malloc/allocchunk.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/vespamalloc/src/vespamalloc/malloc/allocchunk.h b/vespamalloc/src/vespamalloc/malloc/allocchunk.h
index 64f45067e79..1106058ce53 100644
--- a/vespamalloc/src/vespamalloc/malloc/allocchunk.h
+++ b/vespamalloc/src/vespamalloc/malloc/allocchunk.h
@@ -23,9 +23,14 @@ struct TaggedPtr {
#if defined(__x86_64__)
#define VESPA_USE_ATOMIC_TAGGEDPTR
TaggedPtr load(std::memory_order = std::memory_order_seq_cst) {
+ // Not that this is NOT an atomic load. The current use as the initial load
+ // in a compare_exchange loop is safe as a teader load will just give a retry.
return *this;
}
void store(TaggedPtr ptr) {
+ // Not that this is NOT an atomic store. The current use is in a unit test as an initial
+ // store before any threads are started. Just done so keep api compability with std::atomic as
+ // that is the preferred implementation..
*this = ptr;
}
bool