[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: [lwip] reference count
From: |
Mumtaz Ahmad |
Subject: |
[lwip-users] Re: [lwip] reference count |
Date: |
Wed, 08 Jan 2003 23:18:00 -0000 |
Thx .your replies are really giving me power to understand the whole code
well .One more question regarding the same topic is that in which situations
,inside the code, this feature is being used
Thx in advance
Regards
----- Original Message -----
From: Kieran Mansley <address@hidden>
To: <address@hidden>
Sent: Wednesday, March 06, 2002 2:40 PM
Subject: Re: [lwip] reference count
> On Wed, 6 Mar 2002, Mumtaz Ahmad wrote:
>
> > Hi
> > i am also confused about the use of reference count in pbufs . i would
like
> > some explanation of it
>
> They are simply a count of how many references are held to this pbuf. If
> many parts of the code have a reference to a pbuf (ie. it has been copied
> for some reason) then if one of them asks to free it you can't actually
> dispose of the memory until all the others have finished with it too.
> Therefore when you allocate a pbuf, the ref is set to 1. When you copy it
> the reference is increased by 1, and when you free it the reference is
> decreased by 1. Only when the reference gets to zero can the memory
> safely be disposed of.
>
> Kieran
>
> [This message was sent through the lwip discussion list.]
[This message was sent through the lwip discussion list.]
- [lwip-users] Re: [lwip] reference count,
Mumtaz Ahmad <=