summaryrefslogtreecommitdiff
path: root/ext/standard/php_incomplete_class.h
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-02-13 17:54:23 +0400
committerDmitry Stogov <dmitry@zend.com>2014-02-13 17:54:23 +0400
commit40e053e7f333b5fc3f4c75c964600666810cc969 (patch)
tree3436d014c44e3eab00107e67b10229ec0262dbb6 /ext/standard/php_incomplete_class.h
parent6306918ed2c9d87cf5fadc62d210a797a794926e (diff)
downloadphp-git-40e053e7f333b5fc3f4c75c964600666810cc969.tar.gz
Use better data structures (incomplete)
Diffstat (limited to 'ext/standard/php_incomplete_class.h')
-rw-r--r--ext/standard/php_incomplete_class.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h
index b5a2a322f7..9afc5d7d5b 100644
--- a/ext/standard/php_incomplete_class.h
+++ b/ext/standard/php_incomplete_class.h
@@ -30,24 +30,20 @@
/* OBJECTS_FIXME: Fix for new object model */ \
if (Z_OBJ_HT_P(struc)->get_class_entry && \
Z_OBJCE_P(struc) == BG(incomplete_class)) { \
- class_name = php_lookup_class_name(struc, &name_len); \
+ class_name = php_lookup_class_name(struc); \
if (!class_name) { \
- name_len = sizeof(INCOMPLETE_CLASS) - 1; \
- class_name = estrndup(INCOMPLETE_CLASS, name_len); \
+ class_name = STR_INIT(INCOMPLETE_CLASS, sizeof(INCOMPLETE_CLASS) - 1, 0); \
} \
- free_class_name = 1; \
incomplete_class = 1; \
} else { \
- free_class_name = !zend_get_object_classname(struc, (const char **)&class_name, &name_len TSRMLS_CC);\
+ class_name = zend_get_object_classname(struc TSRMLS_CC); \
}
#define PHP_CLEANUP_CLASS_ATTRIBUTES() \
- if (free_class_name) efree(class_name)
+ STR_RELEASE(class_name)
#define PHP_CLASS_ATTRIBUTES \
- char *class_name; \
- zend_uint name_len; \
- zend_bool free_class_name = 0; \
+ zend_string *class_name; \
zend_bool incomplete_class = 0
#define INCOMPLETE_CLASS "__PHP_Incomplete_Class"
@@ -58,7 +54,7 @@ extern "C" {
#endif
PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D);
-PHPAPI char *php_lookup_class_name(zval *object, zend_uint *nlen);
+PHPAPI zend_string *php_lookup_class_name(zval *object);
PHPAPI void php_store_class_name(zval *object, const char *name, zend_uint len);
#ifdef __cplusplus