lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] design choice: pbufs in applications?


From: Adam Dunkels
Subject: [lwip-users] Re: [lwip] design choice: pbufs in applications?
Date: Wed, 08 Jan 2003 22:55:49 -0000

Hi Leon!

On Saturday 12 January 2002 12.07, you wrote:
> A simple, but memory hungry approach, is to copy the
> pbuf chains into a sequential memory aread, dynamically,
> allocated and free each pbuf doing so. After that, your
> application can be kept simple, parsing through that
> memory.
>
> A complex, less memory hungry, but more code hungry
> approach is to have your application deal with the pbuf
> chain. In this case, EACH access to a value or struct
> within the packets has to check whether a pbuf boundary
> is crossed.

A compromise approach could be to check if the entire struct is contained in 
the pbuf. If it is, use the pbuf memory directly to access the struct. If the 
struct isn't entirely in the pbuf, copy the struct from the pbufs into 
dynamically allocated memory and access it from there.

/adam
-- 
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]




reply via email to

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