Quoting Christian Biere <[EMAIL PROTECTED]> from ml.softs.gtk-gnutella.devel:
:Nobody said a word about dereferencing and if you had actually read the
:section, you'd know that just using the pointer's value leads to
:undefined behavior.

That C is just braindead.  If you look at the flow, you'll see that the
pointer's value is actually not used as a pointer but as an integer.
The fact that it is carried by pointer variables is just due to the fact
that the hash table only works with pointers.

:> (presence in the table means the pointer is valid).
:
:Then you don't need the check for "lid" at all. If it's supposed to be a
:consistency check that's fine but then it should be an assertion check.
:If you intend to leave dangling pointers in the table and use the check
:to avoid recycled memory, then it's not.

If the pointer is present in the table, then it is allocated, not dangling.

Also, these pointers are always allocated as far as the implementation
goes because they were allocated through malloc() underneath.  The walloc()
layer on top of that merely redistributes the allocated space among objects,
but the space is not really freed.  None of this memory is really freed.

Raphael

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gtk-gnutella-devel mailing list
gtk-gnutella-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to