[En-Nut-Discussion] DHCP option one byte offset (Big Endian)?

Harald Kipp harald.kipp at egnite.de
Tue Jul 29 12:16:05 CEST 2003


Well, "better" depends on what you want. Your code
looks fast, but consumes a lot of space.

You must also take the call and local variable setup
into account.

If inlined, the optimizer may run out of registers, which
adds additional code and consumes RAM space.

Harald

At 18:26 29.07.2003 +0900, you wrote:
>I use this function . I've compared the asm list outputs, and
>think it is better.
>/*!
>  * \brief Read Long word ,memory alignment ignored.
>  * could be "inline".
>  */
>u_long LongBoundary(void* pt)
>{
>     u_long  ultmp;
>     u_char* psrc;
>     u_char* pdst;
>
>     pdst = (u_char*)(&ultmp);
>     psrc = (u_char*)pt;
>
>     *pdst++ = *psrc++;
>     *pdst++ = *psrc++;
>     *pdst++ = *psrc++;
>     *pdst      = *psrc;
>
>     return ultmp;
>
>}
>
>_______________________________________________
>En-Nut-Discussion mailing list
>En-Nut-Discussion at egnite.de
>http://www.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list