void ponyint_messageq_init(messageq_t* q) { pony_msg_t* stub = POOL_ALLOC(pony_msg_t); stub->size = POOL_INDEX(sizeof(pony_msg_t)); stub->next = NULL; q->head = (pony_msg_t*)((uintptr_t)stub | 1); q->tail = stub; #ifndef NDEBUG messageq_size_debug(q); #endif }
void ponyint_messageq_init(messageq_t* q) { pony_msg_t* stub = POOL_ALLOC(pony_msg_t); stub->index = POOL_INDEX(sizeof(pony_msg_t)); atomic_store_explicit(&stub->next, NULL, memory_order_relaxed); atomic_store_explicit(&q->head, (pony_msg_t*)((uintptr_t)stub | 1), memory_order_relaxed); q->tail = stub; #ifndef NDEBUG messageq_size_debug(q); #endif }