Revision: 14370
Author: adrian.chadd
Date: Sat Nov 14 08:40:13 2009
Log: Try to fix Issue 76 for good - fix radix_remove() to behave correctly

Well, this commit doesn't change radix_remove(), it changes the
radix code to use malloc/free instead of the squid-ified wrappers.
The NULL-ing of a free()'ed pointer was confusing code in radix_remove()
and thus messed up the radix tree.

I think this has finally fixed things..


http://code.google.com/p/lusca-cache/source/detail?r=14370

Modified:
  /branches/LUSCA_HEAD/libcore/radix.c

=======================================
--- /branches/LUSCA_HEAD/libcore/radix.c        Thu Nov 12 23:56:19 2009
+++ /branches/LUSCA_HEAD/libcore/radix.c        Sat Nov 14 08:40:13 2009
@@ -66,8 +66,14 @@
  /*
   * This shows the source of this file - via the python radix tree code!
   */
-#define        PyMem_Malloc    xxmalloc
-#define PyMem_Free     xxfree
+/*
+ * Note that at least one use of free in this code (radix_remove)
+ * uses the original pointer value in subsequent comparisons.
+ * This may be a perfectly fine and valid coding practice but
+ * it means NULL'ing free'd pointers will break things.
+ */
+#define        PyMem_Malloc    malloc
+#define PyMem_Free     free

  /* $Id: radix.c,v 1.17 2007/10/24 06:04:31 djm Exp $ */


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to