Skip to content

Commit

Permalink
fix alignment issue in ikstack meduketto#51
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'alonbl/alignment'
  • Loading branch information
holme-r committed Jun 13, 2018
2 parents 1ea9b48 + 3095fe8 commit 813d69d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ikstack.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ iks_stack_alloc (ikstack *s, size_t size)
if (size < MIN_ALLOC_SIZE) size = MIN_ALLOC_SIZE;
if (size & ALIGN_MASK) size = ALIGN (size);

size += DEFAULT_ALIGNMENT; /* to enable alignment of space */
c = find_space (s, s->meta, size);
if (!c) return NULL;
mem = c->data + c->used;
mem = (void *)ALIGN((char *)mem - (char *)0);
c->used += size;
return mem;
}
Expand Down

0 comments on commit 813d69d

Please sign in to comment.