Tom,

Do you recall what prompted the below patch?  Seems harmless (ultimately a 
no-op), but it'd be concerning if setting the magic number fixed some problem.

The very next line adds that tree pointer to the free list and any reuse from 
the free list will reinitialize with RT_TREE_INIT().  I was going to test 
converting the tree pointers to using the new fast allocating BU_GET/BU_PUT 
routines instead of maintaining a free list and came across this curiosity.

Cheers!
Sean



On Apr 19, 2012, at 6:22 PM, [email protected] wrote:

> Revision: 50186
>          http://brlcad.svn.sourceforge.net/brlcad/?rev=50186&view=rev
> Author:   tbrowder2
> Date:     2012-04-19 22:22:48 +0000 (Thu, 19 Apr 2012)
> Log Message:
> -----------
> reset special magic to normal magic before leaving the function
> 
> Modified Paths:
> --------------
>    brlcad/trunk/src/librt/db_tree.c
> 
> Modified: brlcad/trunk/src/librt/db_tree.c
> ===================================================================
> --- brlcad/trunk/src/librt/db_tree.c  2012-04-19 21:13:00 UTC (rev 50185)
> +++ brlcad/trunk/src/librt/db_tree.c  2012-04-19 22:22:48 UTC (rev 50186)
> @@ -1553,6 +1553,10 @@
>           bu_bomb("db_free_tree\n");
>     }
>     tp->tr_op = 0;            /* sanity */
> +
> +    /* reset magic after recursion */
> +    tp->magic = RT_TREE_MAGIC;
> +
>     RT_FREE_TREE(tp, resp);
> }
> 
> 
> This was sent by the SourceForge.net collaborative development platform, the 
> world's largest Open Source development site.
> 
> 
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2
> _______________________________________________
> BRL-CAD Source Commits mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/brlcad-commits


------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to