Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80064 - trunk/tools/build/v2/engine
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-17 03:23:04


Author: jurko
Date: 2012-08-17 03:23:03 EDT (Fri, 17 Aug 2012)
New Revision: 80064
URL: http://svn.boost.org/trac/boost/changeset/80064

Log:
Fixed Boost Jam's internal list structure allocation bug - due to a typo the list_new() operation did not work correctly on systems where LIST * is smaller than LIST (e.g. if LIST * is smaller than OBJECT * or OBJECT * is smaller than an int). Removed code duplication between list_new() & list_alloc(). Contributed by Kohei Takahashi <flast at flast.jp>.
Text files modified:
   trunk/tools/build/v2/engine/lists.c | 13 +------------
   1 files changed, 1 insertions(+), 12 deletions(-)

Modified: trunk/tools/build/v2/engine/lists.c
==============================================================================
--- trunk/tools/build/v2/engine/lists.c (original)
+++ trunk/tools/build/v2/engine/lists.c 2012-08-17 03:23:03 EDT (Fri, 17 Aug 2012)
@@ -100,18 +100,7 @@
 
 LIST * list_new( OBJECT * value )
 {
- LIST * head;
- if ( freelist[ 0 ] )
- {
- struct freelist_node * result = freelist[ 0 ];
- freelist[ 0 ] = result->next;
- head = (LIST *)result;
- }
- else
- {
- head = BJAM_MALLOC( sizeof( LIST * ) + sizeof( OBJECT * ) );
- }
-
+ LIST * const head = list_alloc( 1 ) ;
     head->impl.size = 1;
     list_begin( head )[ 0 ] = value;
     return head;


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