diff --git a/include/common/memory.h b/include/common/memory.h index a0b6d6203..da96b8292 100644 --- a/include/common/memory.h +++ b/include/common/memory.h @@ -272,7 +272,7 @@ static inline void __pool_free(struct pool_head *pool, void *ptr) do { *POOL_LINK(pool, ptr) = (void *)free_list; __ha_barrier_store(); - } while (!HA_ATOMIC_CAS(&pool->free_list, (void *)&free_list, ptr)); + } while (!HA_ATOMIC_CAS(&pool->free_list, (void **)&free_list, ptr)); HA_ATOMIC_SUB(&pool->used, 1); } diff --git a/src/memory.c b/src/memory.c index 51c623a85..d75dc7e6e 100644 --- a/src/memory.c +++ b/src/memory.c @@ -168,7 +168,7 @@ void *__pool_refill_alloc(struct pool_head *pool, unsigned int avail) do { *POOL_LINK(pool, ptr) = free_list; __ha_barrier_store(); - } while (HA_ATOMIC_CAS(&pool->free_list, (void *)&free_list, ptr) == 0); + } while (HA_ATOMIC_CAS(&pool->free_list, (void **)&free_list, ptr) == 0); } HA_ATOMIC_ADD(&pool->allocated, allocated - allocated_orig); @@ -199,7 +199,7 @@ void pool_flush(struct pool_head *pool) return; do { next = pool->free_list; - } while (!HA_ATOMIC_CAS(&pool->free_list, (void *)&next, NULL)); + } while (!HA_ATOMIC_CAS(&pool->free_list, (void **)&next, NULL)); while (next) { temp = next; next = *POOL_LINK(pool, temp);