gopalv                                   Thu, 28 Jul 2011 03:03:06 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=313805

Log:
merge to trunk - Allow zend_is_interned_string to be pluggable

Changed paths:
    U   php/php-src/trunk/Zend/zend_string.c
    U   php/php-src/trunk/Zend/zend_string.h

Modified: php/php-src/trunk/Zend/zend_string.c
===================================================================
--- php/php-src/trunk/Zend/zend_string.c        2011-07-27 23:35:21 UTC (rev 
313804)
+++ php/php-src/trunk/Zend/zend_string.c        2011-07-28 03:03:06 UTC (rev 
313805)
@@ -30,10 +30,12 @@
 #endif

 ZEND_API const char *(*zend_new_interned_string)(const char *str, int len, int 
free_src TSRMLS_DC);
+ZEND_API zend_bool (*zend_is_interned_string)(const char *str TSRMLS_DC);
 ZEND_API void (*zend_interned_strings_snapshot)(TSRMLS_D);
 ZEND_API void (*zend_interned_strings_restore)(TSRMLS_D);

 static const char *zend_new_interned_string_int(const char *str, int len, int 
free_src TSRMLS_DC);
+static zend_bool zend_is_interned_string_int(const char *str TSRMLS_DC);
 static void zend_interned_strings_snapshot_int(TSRMLS_D);
 static void zend_interned_strings_restore_int(TSRMLS_D);

@@ -64,6 +66,7 @@
 #endif

        zend_new_interned_string = zend_new_interned_string_int;
+       zend_is_interned_string = zend_is_interned_string_int;
        zend_interned_strings_snapshot = zend_interned_strings_snapshot_int;
        zend_interned_strings_restore = zend_interned_strings_restore_int;
 }
@@ -177,6 +180,11 @@
 #endif
 }

+static zend_bool zend_is_interned_string_int(const char *s TSRMLS_DC)
+{
+       return (((s) >= CG(interned_strings_start)) && ((s) < 
CG(interned_strings_end)));
+}
+
 static void zend_interned_strings_snapshot_int(TSRMLS_D)
 {
        CG(interned_strings_snapshot_top) = CG(interned_strings_top);

Modified: php/php-src/trunk/Zend/zend_string.h
===================================================================
--- php/php-src/trunk/Zend/zend_string.h        2011-07-27 23:35:21 UTC (rev 
313804)
+++ php/php-src/trunk/Zend/zend_string.h        2011-07-28 03:03:06 UTC (rev 
313805)
@@ -24,6 +24,7 @@
 #include "zend.h"

 ZEND_API extern const char *(*zend_new_interned_string)(const char *str, int 
len, int free_src TSRMLS_DC);
+ZEND_API extern zend_bool (*zend_is_interned_string)(const char *str 
TSRMLS_DC);
 ZEND_API extern void (*zend_interned_strings_snapshot)(TSRMLS_D);
 ZEND_API extern void (*zend_interned_strings_restore)(TSRMLS_D);

@@ -33,7 +34,7 @@
 #ifndef ZTS

 #define IS_INTERNED(s) \
-       (((s) >= CG(interned_strings_start)) && ((s) < 
CG(interned_strings_end)))
+       (zend_is_interned_string ? zend_is_interned_string((s) TSRMLS_CC) : 0)

 #else


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to