lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] CVS current crashes for me? Anyone else?


From: Marc Boucher
Subject: Re: [lwip-users] CVS current crashes for me? Anyone else?
Date: Sun, 18 May 2003 21:20:11 +0200
User-agent: Mutt/1.5.1i

Hi,

On Thu, May 15, 2003 at 03:42:19PM +0200, address@hidden wrote:
> 
> the current code crashes for me in memp_init() whereas
> STABLE is... wel... stable :-)
> 
> My memory alignment is 2 bytes (for our 16-bit processor).
> 
> I noticed some alignment macro's have been rewritten.
> 
> Did someone else experience problems with the CVS main
> branch? I do not have time to investigate right now whether
> this is a lwIP or application specific bug, but I'll let you all
> know ASAP.
> 
> Regards,
> 
> Leon.

I had a similar problem with the new macros and fixed it this way:

--- ../lwip-cvs-20030518/src/include/lwip/mem.h 2003-05-12 14:18:14.000000000 
+0200
+++ ../lwip-cvs-20030518-mb/src/include/lwip/mem.h      2003-05-18 
21:08:05.000000000 +0200
@@ -49,9 +49,9 @@
 void *mem_realloc(void *mem, mem_size_t size);
 void *mem_reallocm(void *mem, mem_size_t size);
 
-#define MEM_ALIGN_SIZE(size) ((size + MEM_ALIGNMENT - 1) & ~(MEM_ALIGNMENT-1))
+#define MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1) & 
~(MEM_ALIGNMENT-1))
 
-#define MEM_ALIGN(addr) (void *)MEM_ALIGN_SIZE((mem_ptr_t)addr)
+#define MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & 
~(mem_ptr_t)(MEM_ALIGNMENT-1)))
 
 #endif /* __LWIP_MEM_H__ */
 

(if it still doesn't work afterwards, I would recommend double-checking your 
platform's
mem_ptr_t definition)

Cheers
Marc





reply via email to

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