- // malloc a new SyncData and add to list.
- // XXX calling malloc with a global lock held is bad practice,
- // might be worth releasing the lock, mallocing, and searching again.
- // But since we never free these guys we won't be stuck in malloc very often.
- result = (SyncData*)calloc(sizeof(SyncData), 1);
+ // Allocate a new SyncData and add to list.
+ // XXX allocating memory with a global lock held is bad practice,
+ // might be worth releasing the lock, allocating, and searching again.
+ // But since we never free these guys we won't be stuck in allocation very often.
+ posix_memalign((void **)&result, alignof(SyncData), sizeof(SyncData));