[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #17922] mem_malloc bug
From: |
Andreas Funcke |
Subject: |
[lwip-devel] [bug #17922] mem_malloc bug |
Date: |
Tue, 23 Jan 2007 12:45:34 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1 |
Follow-up Comment #5, bug #17922 (project lwip):
In my opinion the following Code does the same as using ā_attribute_
((aligned (MEM_ALIGNMENT)))ā. Iām not an expert in C programming and lwip
so there might be another problem.
#if MEM_ALIGNMENT == 1
static u8_t ram[MEM_SIZE + sizeof(struct mem) + MEM_ALIGNMENT];
#elif MEM_ALIGNMENT == 2
static u16_t ram16[(MEM_SIZE + sizeof(struct mem) + MEM_ALIGNMENT)>>1];
static u8_t *ram = (u8_t *)ram16;
#elif MEM_ALIGNMENT == 4
static u32_t ram32[(MEM_SIZE + sizeof(struct mem) + MEM_ALIGNMENT)>>2];
static u8_t *ram = (u8_t *)ram32;
#elif MEM_ALIGNMENT == 8
static u64_t ram64[(MEM_SIZE + sizeof(struct mem) + MEM_ALIGNMENT)>>3];
static u8_t *ram = (u8_t *)ram64;
#else
#error "unhandled MEM_ALIGNMENT size"
#endif
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?17922>
_______________________________________________
Nachricht geschickt von/durch Savannah
http://savannah.nongnu.org/