[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: Gecko/20061204 Firefox/

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. 

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;
#error "unhandled MEM_ALIGNMENT size"


Reply to this item at:


  Nachricht geschickt von/durch Savannah

reply via email to

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