|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75939 - trunk/tools/build/v2/engine
From: steven_at_[hidden]
Date: 2011-12-14 14:33:15
Author: steven_watanabe
Date: 2011-12-14 14:33:14 EST (Wed, 14 Dec 2011)
New Revision: 75939
URL: http://svn.boost.org/trac/boost/changeset/75939
Log:
Inline object functions.
Text files modified:
trunk/tools/build/v2/engine/object.c | 7 +++++++
trunk/tools/build/v2/engine/object.h | 23 +++++++++++++++++++++--
2 files changed, 28 insertions(+), 2 deletions(-)
Modified: trunk/tools/build/v2/engine/object.c
==============================================================================
--- trunk/tools/build/v2/engine/object.c (original)
+++ trunk/tools/build/v2/engine/object.c 2011-12-14 14:33:14 EST (Wed, 14 Dec 2011)
@@ -29,6 +29,8 @@
#define OBJECT_MAGIC 0xa762e0e3u
+#ifndef object_copy
+
struct hash_header
{
#ifndef NDEBUG
@@ -38,6 +40,8 @@
struct hash_item * next;
};
+#endif
+
struct hash_item
{
struct hash_header header;
@@ -257,6 +261,7 @@
#endif
}
+#ifndef object_copy
/*
* object_copy() - return a copy of an object
@@ -330,6 +335,8 @@
#endif
}
+#endif
+
/*
* object_done() - free string tables.
*/
Modified: trunk/tools/build/v2/engine/object.h
==============================================================================
--- trunk/tools/build/v2/engine/object.h (original)
+++ trunk/tools/build/v2/engine/object.h 2011-12-14 14:33:14 EST (Wed, 14 Dec 2011)
@@ -14,11 +14,30 @@
typedef struct _object OBJECT;
OBJECT * object_new ( const char * );
+void object_done ( void );
+
+#if defined(NDEBUG) && !defined(BJAM_NO_MEM_CACHE)
+
+struct hash_header
+{
+ unsigned int hash;
+ struct hash_item * next;
+};
+
+#define object_str( obj ) ( (const char *)( obj ) )
+#define object_copy( obj ) ( obj )
+#define object_free( obj ) ( (void)0 )
+#define object_equal( lhs, rhs ) ( ( lhs ) == ( rhs ) )
+#define object_hash( obj ) ( ((struct hash_header *)( (char *)( obj ) - sizeof(struct hash_header) ))->hash )
+
+#else
+
+const char * object_str ( OBJECT * );
OBJECT * object_copy ( OBJECT * );
void object_free ( OBJECT * );
-const char * object_str ( OBJECT * );
-void object_done ( void );
int object_equal ( OBJECT *, OBJECT * );
unsigned int object_hash ( OBJECT * );
#endif
+
+#endif
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