summaryrefslogtreecommitdiffstats
path: root/core/safe_refcount.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-07 18:25:37 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-01-07 18:26:38 -0300
commit2ab83e1abbf5ee6d00e16056a9e9394114026f28 (patch)
tree7efbb375cc4d00d8e8589fcf1b6a1303bec5df2d /core/safe_refcount.cpp
parent2a38a5eaa844043b846e03d6655f84caf8a31e74 (diff)
downloadredot-engine-2ab83e1abbf5ee6d00e16056a9e9394114026f28.tar.gz
Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector
Diffstat (limited to 'core/safe_refcount.cpp')
-rw-r--r--core/safe_refcount.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp
index f0d4fbd610..ede37bbe8a 100644
--- a/core/safe_refcount.cpp
+++ b/core/safe_refcount.cpp
@@ -76,6 +76,9 @@ uint32_t atomic_decrement( register uint32_t * pw ) {
return InterlockedDecrement( (LONG volatile*)pw );
}
+uint32_t atomic_increment( register uint32_t * pw ) {
+ return InterlockedIncrement( (LONG volatile*)pw );
+}
#elif defined(__GNUC__)
uint32_t atomic_conditional_increment( register uint32_t * pw ) {
@@ -95,6 +98,12 @@ uint32_t atomic_decrement( register uint32_t * pw ) {
}
+uint32_t atomic_increment( register uint32_t * pw ) {
+
+ return __sync_add_and_fetch(pw,1);
+
+}
+
#else
//no threads supported?
#error Must provide atomic functions for this platform or compiler!