Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83825 - trunk/tools/build/v2/engine/modules
From: steven_at_[hidden]
Date: 2013-04-09 17:07:47


Author: steven_watanabe
Date: 2013-04-09 17:07:47 EDT (Tue, 09 Apr 2013)
New Revision: 83825
URL: http://svn.boost.org/trac/boost/changeset/83825

Log:
Optimize property-set initialization by reducing passing of large lists.
Text files modified:
   trunk/tools/build/v2/engine/modules/property-set.c | 33 ++++++++++++++++++++++++++++-----
   1 files changed, 28 insertions(+), 5 deletions(-)

Modified: trunk/tools/build/v2/engine/modules/property-set.c
==============================================================================
--- trunk/tools/build/v2/engine/modules/property-set.c (original)
+++ trunk/tools/build/v2/engine/modules/property-set.c 2013-04-09 17:07:47 EDT (Tue, 09 Apr 2013)
@@ -13,6 +13,7 @@
 #include "../native.h"
 #include "../compile.h"
 #include "../mem.h"
+#include "string.h"
 
 struct ps_map_entry
 {
@@ -156,13 +157,35 @@
     }
     else
     {
- OBJECT * const rulename = object_new( "new" );
- LIST * val = call_rule( rulename, frame, list_append( list_new( object_new(
- "property-set" ) ), unique ), 0 );
- /* The 'unique' variable is freed in 'call_rule'. */
+ OBJECT * rulename = object_new( "new" );
+ OBJECT * varname = object_new( "self.raw" );
+ LIST * val = call_rule( rulename, frame,
+ list_new( object_new( "property-set" ) ), 0 );
+ LISTITER iter, end;
         object_free( rulename );
         pos->value = list_front( val );
- pos->key = var_get( bindmodule( pos->value ), object_new( "self.raw" ) );
+ var_set( bindmodule( pos->value ), varname, unique, VAR_SET );
+ object_free( varname );
+
+ for ( iter = list_begin( unique ), end = list_end( unique ); iter != end; ++iter )
+ {
+ const char * str = object_str( list_item( iter ) );
+ if ( str[ 0 ] != '<' || ! strchr( str, '>' ) )
+ {
+ string message[ 1 ];
+ string_new( message );
+ string_append( message, "Invalid property: '" );
+ string_append( message, str );
+ string_append( message, "'" );
+ rulename = object_new( "errors.error" );
+ call_rule( rulename, frame,
+ list_new( object_new( message->value ) ), 0 );
+ /* unreachable */
+ string_free( message );
+ object_free( rulename );
+ }
+ }
+
         return val;
     }
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk