Revision: 53653
http://brlcad.svn.sourceforge.net/brlcad/?rev=53653&view=rev
Author: brlcad
Date: 2012-11-11 06:03:13 +0000 (Sun, 11 Nov 2012)
Log Message:
-----------
the non-AVS_ADD version no longer compiles, is longer, and the performance
claim is unproven so just stay with the simpler form until it's an observed
problem.
Modified Paths:
--------------
brlcad/trunk/src/librt/attributes.c
Modified: brlcad/trunk/src/librt/attributes.c
===================================================================
--- brlcad/trunk/src/librt/attributes.c 2012-11-11 06:02:07 UTC (rev 53652)
+++ brlcad/trunk/src/librt/attributes.c 2012-11-11 06:03:13 UTC (rev 53653)
@@ -78,16 +78,13 @@
*/
bu_avs_init(avs, count, "db5_import_attributes");
- /* Second pass -- populate attributes. Peek inside struct for non
AVS_ADD. */
+ /* Second pass -- populate attributes. */
-/* Use AVS_ADD to copy the values from the external buffer instead of
- * using them directly without copying. This presumes ap will not get
- * free'd before we're done with the avs. Preference should be to
- * leave AVS_ADD undefined for performance reasons.
- */
-#define AVS_ADD 1
+ /* Copy the values from the external buffer instead of using them
+ * directly without copying. This presumes ap will not get free'd
+ * before we're done with the avs.
+ */
-#if AVS_ADD
cp = (const char *)ap->ext_buf;
while (*cp != '\0') {
const char *name = cp; /* name */
@@ -95,29 +92,7 @@
bu_avs_add(avs, name, cp);
cp += strlen(cp)+1; /* next name */
}
-#else
- /* Conserve malloc/free activity -- use strings in input buffer */
- /* Signal region of memory that input comes from */
- cp = (const char *)ap->ext_buf;
- app = avs->avp;
- while (*cp != '\0') {
- app->name = cp; /* name */
- cp += strlen(cp)+1;
- app->value = cp; /* value */
- cp += strlen(cp)+1;
- app++;
- avs->count++;
- }
- /* expand the readonly section if necessary */
- if ((!avs->readonly_min) || ((genptr_t)avs->readonly_min >
(genptr_t)ap->ext_buf)) {
- avs->readonly_min = (genptr_t)ap->ext_buf;
- }
- if ((!avs->readonly_max) || ((genptr_t)avs->readonly_max <
(genptr_t)(avs->readonly_min + ap->ext_nbytes))) {
- avs->readonly_max = (genptr_t)avs->readonly_min + ap->ext_nbytes;
- }
-#endif
-
BU_ASSERT_PTR(cp+1, ==, ep);
BU_ASSERT_LONG(avs->count, <=, avs->max);
BU_ASSERT_LONG((size_t)avs->count, ==, (size_t)count);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits