http://man7.org/linux/man-pages/man3/malloc.3.html

RETURN VALUE         top

       The malloc() and calloc() functions return a pointer to the allocated
       memory, which is suitably aligned for any built-in type.

因为占内存最多的变量类型为double和int64,都是8字节。

那么,malloc返回的地址都是8字节对齐的吗?

对于lwip的mem_alloc()也是都是8字节对齐吗?

 

https://stackoverflow.com/questions/8752546/how-does-malloc-understand-alignment

相关文章:

  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
猜你喜欢
  • 2022-12-23
  • 2021-08-30
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2021-05-04
  • 2021-11-23
相关资源
相似解决方案