lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] What is the memory alignment of the pointer returned by mem


From: yanhc519
Subject: [lwip-users] What is the memory alignment of the pointer returned by mem alloc() in mem.c?
Date: Sat, 25 May 2019 22:19:16 +0800

Hi all.

What is the memory alignment of the pointer returned by mem_alloc() in mem.c?
Since the only argument of mem_alloc() is size, so what alignment will mem_alloc() choose?

In http://man7.org/linux/man-pages/man3/malloc.3.html, it says "The malloc() and calloc() functions return a pointer to the allocated memory, which is suitably aligned for any built-in type."
Since the largest type is double or int64 which are 8 bytes, so I guess malloc() in linux will choose alignment of 8 bytes.

Is this guess also applied to mem_alloc() in LwIP? 
That is, does mem_alloc() in LwIP also choose alignment of 8 bytes?

Thanks!
Best regard,

yan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]