summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mem.c4
-rw-r--r--src/thread.c8
2 files changed, 2 insertions, 10 deletions
diff --git a/src/mem.c b/src/mem.c
index 185da4f..3392011 100644
--- a/src/mem.c
+++ b/src/mem.c
@@ -151,7 +151,7 @@
*
* See the description of mem_alloc() in the public header.
*/
-#define MEM_ALIGN 4
+#define MEM_ALIGN 8
/*
* Minimum size of a block.
@@ -208,7 +208,7 @@ struct mem_btag {
*/
struct mem_block {
struct mem_btag btag;
- char payload[];
+ char payload[] __aligned(MEM_ALIGN);
};
/*
diff --git a/src/thread.c b/src/thread.c
index 6687191..bb5ddc4 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -592,14 +592,6 @@ thread_init(struct thread *thread, thread_fn_t fn, void *arg,
const char *name, char *stack, size_t stack_size,
unsigned int priority)
{
- if (!P2ALIGNED((uint32_t)stack, CPU_STACK_ALIGN)) {
- char *aligned_stack;
-
- aligned_stack = (char *)(P2ALIGN((uintptr_t)stack, CPU_STACK_ALIGN));
- stack_size -= (stack - aligned_stack);
- stack = aligned_stack;
- }
-
/*
* New threads are created in a state that is similar to preempted threads,
* since it makes running them for the first time indistinguishable from