summaryrefslogtreecommitdiff
path: root/ruby_atomic.h
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-22 04:35:18 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-22 04:35:18 +0000
commitd382c46a723cb191369707fd18b4bfa5f6709d1b (patch)
treefa415fa742cce20ff3b0b31e9150d27dcfa05507 /ruby_atomic.h
parenta98f024d5c977ff3de28ed67062c73c4ec57d841 (diff)
merge revision(s) 44568: [Backport #9399]
* iseq.c (iseq_load): keep type_map to get rid of memory leak. based on a patch by Eric Wong at [ruby-core:59699]. [Bug #9399] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_atomic.h')
-rw-r--r--ruby_atomic.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ruby_atomic.h b/ruby_atomic.h
index 69efbdc4c4..789efdc4ea 100644
--- a/ruby_atomic.h
+++ b/ruby_atomic.h
@@ -161,5 +161,10 @@ atomic_size_exchange(size_t *ptr, size_t val)
# define ATOMIC_PTR_EXCHANGE(var, val) (void *)ATOMIC_SIZE_EXCHANGE(*(size_t *)&(var), (size_t)(val))
# endif
#endif
+#ifndef ATOMIC_PTR_CAS
+# if SIZEOF_VOIDP == SIZEOF_SIZE_T
+# define ATOMIC_PTR_CAS(var, oldval, val) (void *)ATOMIC_SIZE_CAS(*(size_t *)&(var), (size_t)(oldval), (size_t)(val))
+# endif
+#endif
#endif /* RUBY_ATOMIC_H */