diff options
author | Jason Evans <je@fb.com> | 2012-03-05 20:16:57 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2012-03-05 20:16:57 (GMT) |
commit | 3492daf1ce6fb85040d28dfd4dcb51cbf6b0da51 (patch) | |
tree | 10ddd3ddcdd2ef769ed0681ac6dfb2c0ecf57980 /include | |
parent | 6684cacfa8fa9d82762983bce11bb953ce62ba8e (diff) | |
download | jemalloc-3492daf1ce6fb85040d28dfd4dcb51cbf6b0da51.zip jemalloc-3492daf1ce6fb85040d28dfd4dcb51cbf6b0da51.tar.gz jemalloc-3492daf1ce6fb85040d28dfd4dcb51cbf6b0da51.tar.bz2 |
Add SH4 and mips architecture support.
Submitted by Andreas Vinsander.
Diffstat (limited to 'include')
-rw-r--r-- | include/jemalloc/internal/atomic.h | 16 | ||||
-rw-r--r-- | include/jemalloc/internal/jemalloc_internal.h.in | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/jemalloc/internal/atomic.h b/include/jemalloc/internal/atomic.h index 8c68593..1dbb7d6 100644 --- a/include/jemalloc/internal/atomic.h +++ b/include/jemalloc/internal/atomic.h @@ -160,6 +160,22 @@ atomic_sub_uint32(uint32_t *p, uint32_t x) return (x); } +#elif (defined __SH4__ || defined __mips__) && (__GNUC__ > 4 || \ + (__GNUC__ == 4 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && \ + __GNUC_PATCHLEVEL__ > 1)))) +JEMALLOC_INLINE uint32_t +atomic_add_uint32(uint32_t *p, uint32_t x) +{ + + return (__sync_add_and_fetch(p, x)); +} + +JEMALLOC_INLINE uint32_t +atomic_sub_uint32(uint32_t *p, uint32_t x) +{ + + return (__sync_sub_and_fetch(p, x)); +} #else # error "Missing implementation for 32-bit atomic operations" #endif diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in index 403e480..3e445f7 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -254,6 +254,9 @@ extern void (*je_malloc_message)(void *wcbopaque, const char *s); # ifdef __s390x__ # define LG_QUANTUM 4 # endif +# ifdef __SH4__ +# define LG_QUANTUM 4 +# endif # ifdef __tile__ # define LG_QUANTUM 4 # endif |