Recent changes in Unikraft modified uk_palloc()'s signature and
guarantees: allocation sizes are given with the number of pages and
the returned memory is not necessarily aligned to the size.
By using uk_posix_memalign() we restore our assumptions in the code.
Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
void *alloc_stack()
{
struct uk_sched *sched = uk_sched_get_default();
- void *stack = uk_palloc(sched->allocator, __STACK_SIZE_PAGE_ORDER);
+ void *stack;
+
+ uk_posix_memalign(sched->allocator,
+ &stack, __STACK_SIZE, __STACK_SIZE);
if (stack == NULL)
printf("error allocating stack\n");
return stack;