[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #48300] Private mempools allocate foreign memory
From: |
Dirk Ziegelmeier |
Subject: |
[lwip-devel] [bug #48300] Private mempools allocate foreign memory |
Date: |
Fri, 24 Jun 2016 13:14:08 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0 |
Follow-up Comment #6, bug #48300 (project lwip):
Adding these bytes is a waste of memory. A better fix would be to enforce
alignment on these buffers. We would need PORTABLE alignment macros like for
packing...
Does anyone have a PORTABLE solution?
- gcc
- IAR
- MSVC
- ...
Maybe using a naturally aligned datatype would be a solution? e.g. declaring
the pool as u32_t. For your actual problem, you need to use uint64_t (AFAIK at
least ARM aligns it to 8 byte for FPU reasons).
#define LWIP_MEMPOOL_DECLARE(name,num,size,desc) LWIP_MEMPOOL_TYPE
memp_memory_ ## name ## _base \
[(((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))) / sizeof(LWIP_MEMPOOL_TYPE)];
\
Could you please try it?
Others, any comments to this (a little bit hackerish) solution?
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?48300>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #48300] Private mempools allocate foreign memory, chrysn, 2016/06/23
- [lwip-devel] [bug #48300] Private mempools allocate foreign memory, chrysn, 2016/06/23
- [lwip-devel] [bug #48300] Private mempools allocate foreign memory, Dirk Ziegelmeier, 2016/06/23
- [lwip-devel] [bug #48300] Private mempools allocate foreign memory, chrysn, 2016/06/24
- [lwip-devel] [bug #48300] Private mempools allocate foreign memory, Dirk Ziegelmeier, 2016/06/24
- [lwip-devel] [bug #48300] Private mempools allocate foreign memory, Dirk Ziegelmeier, 2016/06/24
- [lwip-devel] [bug #48300] Private mempools allocate foreign memory, chrysn, 2016/06/24
- [lwip-devel] [bug #48300] Private mempools allocate foreign memory,
Dirk Ziegelmeier <=
- [lwip-devel] [bug #48300] Private mempools allocate foreign memory, Simon Goldschmidt, 2016/06/27
- [lwip-devel] [bug #48300] Private mempools allocate foreign memory, Simon Goldschmidt, 2016/06/30
- [lwip-devel] [bug #48300] Private mempools allocate foreign memory, Simon Goldschmidt, 2016/06/30