mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-01-11 03:23:43 +01:00
(sos_alloc): Fix call to cmpxchg_ptr().
(Logical change 1.136)
This commit is contained in:
parent
7661874fbe
commit
ac224b48bb
1 changed files with 3 additions and 3 deletions
|
@ -48,11 +48,12 @@ sos_alloc (size_t size)
|
|||
#ifdef HAVE_CMPXCHG
|
||||
union {
|
||||
long *lp;
|
||||
char *cp;
|
||||
char **cp;
|
||||
} u;
|
||||
char *old_mem;
|
||||
|
||||
size = (size + MAX_ALIGN - 1) & -MAX_ALIGN;
|
||||
u.cp = &sos_memp;
|
||||
do
|
||||
{
|
||||
old_mem = sos_memp;
|
||||
|
@ -61,9 +62,8 @@ sos_alloc (size_t size)
|
|||
mem += size;
|
||||
if (mem >= sos_memory + sizeof (sos_memory))
|
||||
abort ();
|
||||
u.cp = sos_memp;
|
||||
}
|
||||
while (!cmpxchg_ptr (&u.lp, old_mem, mem));
|
||||
while (!cmpxchg_ptr (u.lp, old_mem, mem));
|
||||
#else
|
||||
static pthread_mutex_t sos_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
sigset_t saved_sigmask;
|
||||
|
|
Loading…
Reference in a new issue