diff options
author | Arun Sharma <asharma@fb.com> | 2012-09-29 12:22:47 -0700 |
---|---|---|
committer | Arun Sharma <asharma@fb.com> | 2012-09-29 12:22:47 -0700 |
commit | cb3fbbb1729254e9a49e3f8fbe1cadbd519ece52 (patch) | |
tree | 1ccc42ae4875735ae2b73701689784aeca323e3c | |
parent | 6456da2dc10d13e00b79ac3b366617342d964e5a (diff) | |
download | libunwind-cb3fbbb1729254e9a49e3f8fbe1cadbd519ece52.tar.gz |
Reduce the number of ifdefs in machine independent codev1.1-rc1
Hopefully we don't have too many GNUC users who don't have
fetch and add.
-rw-r--r-- | src/mi/mempool.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/mi/mempool.c b/src/mi/mempool.c index e5679044..dbc183fa 100644 --- a/src/mi/mempool.c +++ b/src/mi/mempool.c @@ -50,12 +50,10 @@ sos_alloc (size_t size) size = UNW_ALIGN(size, MAX_ALIGN); -#if defined(__GNUC__) +#if defined(__GNUC__) && defined(HAVE_FETCH_AND_ADD) /* Assume `sos_memory' is suitably aligned. */ assert(((uintptr_t) &sos_memory[0] & (MAX_ALIGN-1)) == 0); -#endif -#if defined(__GNUC__) && defined(HAVE_FETCH_AND_ADD) pos = fetch_and_add (&sos_memory_freepos, size); #else static define_lock (sos_lock); @@ -63,7 +61,6 @@ sos_alloc (size_t size) lock_acquire (&sos_lock, saved_mask); { -# ifndef __GNUC__ /* No assumptions about `sos_memory' alignment. */ if (sos_memory_freepos == 0) { @@ -71,7 +68,6 @@ sos_alloc (size_t size) - (uintptr_t) &sos_memory[0]; sos_memory_freepos = align; } -# endif pos = sos_memory_freepos; sos_memory_freepos += size; } |