Skip to content

Commit

Permalink
HG util: fix alignment issue in mercury_atomic_queue
Browse files Browse the repository at this point in the history
  • Loading branch information
soumagne committed Jul 15, 2020
1 parent 58fd5e2 commit d190059
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/mercury_atomic_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ hg_atomic_queue_alloc(unsigned int count)
HG_UTIL_CHECK_ERROR_NORET(
!powerof2(count), done, "atomic queue size must be power of 2");

hg_atomic_queue = malloc(
hg_atomic_queue = hg_mem_aligned_alloc(HG_MEM_CACHE_LINE_SIZE,
sizeof(struct hg_atomic_queue) + count * sizeof(hg_atomic_int64_t));
HG_UTIL_CHECK_ERROR_NORET(
hg_atomic_queue == NULL, done, "Could not allocate atomic queue");
Expand All @@ -79,5 +79,5 @@ hg_atomic_queue_alloc(unsigned int count)
void
hg_atomic_queue_free(struct hg_atomic_queue *hg_atomic_queue)
{
free(hg_atomic_queue);
hg_mem_aligned_free(hg_atomic_queue);
}

0 comments on commit d190059

Please sign in to comment.