[Lxml-checkins] r50173 - in lxml/trunk: . src/lxml
scoder at codespeak.net
scoder at codespeak.net
Sat Dec 29 17:14:36 CET 2007
Author: scoder
Date: Sat Dec 29 17:14:35 2007
New Revision: 50173
Modified:
lxml/trunk/ (props changed)
lxml/trunk/src/lxml/etree_defs.h
Log:
r3194 at delle: sbehnel | 2007-12-29 16:52:23 +0100
make explicit that tuple creation in PY_NEW is an unlikely case
Modified: lxml/trunk/src/lxml/etree_defs.h
==============================================================================
--- lxml/trunk/src/lxml/etree_defs.h (original)
+++ lxml/trunk/src/lxml/etree_defs.h Sat Dec 29 17:14:35 2007
@@ -101,12 +101,23 @@
#define _cstr(s) PyString_AS_STRING(s)
#define _fqtypename(o) (((PyTypeObject*)o)->ob_type->tp_name)
+#ifdef __GNUC__
+/* Test for GCC > 2.95 */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
+#define unlikely_condition(x) __builtin_expect((x), 0)
+#else /* __GNUC__ > 2 ... */
+#define unlikely_condition(x) (x)
+#endif /* __GNUC__ > 2 ... */
+#else /* __GNUC__ */
+#define unlikely_condition(x) (x)
+#endif /* __GNUC__ */
+
static PyObject* __PY_NEW_GLOBAL_EMPTY_TUPLE = NULL;
#define PY_NEW(T) \
(((PyTypeObject*)(T))->tp_new( \
(PyTypeObject*)(T), \
- ((__PY_NEW_GLOBAL_EMPTY_TUPLE == NULL) ? \
+ (unlikely_condition(__PY_NEW_GLOBAL_EMPTY_TUPLE == NULL) ? \
(__PY_NEW_GLOBAL_EMPTY_TUPLE = PyTuple_New(0)) : \
(__PY_NEW_GLOBAL_EMPTY_TUPLE)), \
NULL))
More information about the lxml-checkins
mailing list