[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] Purpose of memory alignment check
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-devel] Purpose of memory alignment check |
Date: |
Tue, 13 Mar 2012 14:22:10 +0100 |
"Boštjan Meglič" <address@hidden> wrote:
> On our architecture sizeof(void *) returns 2; that is 2 words.
> MEM_ALIGNMENT is set to 2.
>
> So, shouldn't the number 4 be replaced with MEM_ALIGNMENT?
> #define IS_SOCK_ADDR_ALIGNED(name) ((((mem_ptr_t)(name)) %
> MEM_ALIGNMENT) == 0)
Not necessarily. I'll have to admit though that for 16 bit platforms, the '4'
isn't correct. I guess asserting on 'LWIP_MIN(MEM_ALIGNMENT, 4)' would be OK
though...
Simon
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de