summaryrefslogtreecommitdiff
path: root/ext/intl/collator/collator_class.c
diff options
context:
space:
mode:
authorStanley Sufficool <ssufficool@php.net>2014-10-20 21:33:32 -0700
committerStanley Sufficool <ssufficool@php.net>2014-10-20 21:33:32 -0700
commit8defcb855ab01d9c8ab4759cb793d80149b55a8c (patch)
treeed51eb30a2cbc92b102557498fb3e4113da1bb07 /ext/intl/collator/collator_class.c
parent9c7dbb0487f5991fde03873ea8f5e66d6688415f (diff)
parentbaddb1c73a170ef1d2c31bd54cddbc6e1ab596b9 (diff)
downloadphp-git-8defcb855ab01d9c8ab4759cb793d80149b55a8c.tar.gz
Merge branch 'master' of https://git.php.net/push/php-src
* 'master' of https://git.php.net/push/php-src: (6215 commits) Extra comma Moved proxy object support in ASSIGN_ADD (and family) from VM to slow paths of corresponding operators Simplification zend_get_property_info_quick() cleanup and optimization initialize lineno before calling compile file file in phar Use ADDREF instead of DUP, it must be enough. Removed old irrelevant comment fixed compilation error Fix bug #68262: Broken reference across cloned objects export functions needed for phpdbg Fixed compilation Optimized property access handlers. Removed EG(std_property_info). Fixed bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads) Don't make difference between undefined and unaccessible properies when call __get() and family Don't make useless CSE array_pop/array_shift optimization check for zlib headers as well as lib for mysqlnd a realpath cache key can be int or float, catching this News entry for new curl constants News entry for new curl constants ...
Diffstat (limited to 'ext/intl/collator/collator_class.c')
-rw-r--r--ext/intl/collator/collator_class.c41
1 files changed, 16 insertions, 25 deletions
diff --git a/ext/intl/collator/collator_class.c b/ext/intl/collator/collator_class.c
index d1fa10ef2c..fd3f08e359 100644
--- a/ext/intl/collator/collator_class.c
+++ b/ext/intl/collator/collator_class.c
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -36,48 +36,36 @@ static zend_object_handlers Collator_handlers;
*/
/* {{{ Collator_objects_dtor */
-static void Collator_objects_dtor(
- void *object,
- zend_object_handle handle TSRMLS_DC )
+static void Collator_objects_dtor(zend_object *object TSRMLS_DC )
{
- zend_objects_destroy_object( object, handle TSRMLS_CC );
+ zend_objects_destroy_object(object TSRMLS_CC );
}
/* }}} */
/* {{{ Collator_objects_free */
-void Collator_objects_free( zend_object *object TSRMLS_DC )
+void Collator_objects_free(zend_object *object TSRMLS_DC )
{
- Collator_object* co = (Collator_object*)object;
+ Collator_object* co = php_intl_collator_fetch_object(object);
- zend_object_std_dtor( &co->zo TSRMLS_CC );
+ zend_object_std_dtor(&co->zo TSRMLS_CC );
- collator_object_destroy( co TSRMLS_CC );
-
- efree( co );
+ collator_object_destroy(co TSRMLS_CC );
}
/* }}} */
/* {{{ Collator_object_create */
-zend_object_value Collator_object_create(
- zend_class_entry *ce TSRMLS_DC )
+zend_object *Collator_object_create(zend_class_entry *ce TSRMLS_DC )
{
- zend_object_value retval;
Collator_object* intern;
- intern = ecalloc( 1, sizeof(Collator_object) );
- intl_error_init( COLLATOR_ERROR_P( intern ) TSRMLS_CC );
- zend_object_std_init( &intern->zo, ce TSRMLS_CC );
+ intern = ecalloc(1, sizeof(Collator_object) + sizeof(zval) * (ce->default_properties_count - 1));
+ intl_error_init(COLLATOR_ERROR_P(intern) TSRMLS_CC);
+ zend_object_std_init(&intern->zo, ce TSRMLS_CC );
object_properties_init(&intern->zo, ce);
- retval.handle = zend_objects_store_put(
- intern,
- Collator_objects_dtor,
- (zend_objects_free_object_storage_t)Collator_objects_free,
- NULL TSRMLS_CC );
-
- retval.handlers = &Collator_handlers;
+ intern->zo.handlers = &Collator_handlers;
- return retval;
+ return &intern->zo;
}
/* }}} */
@@ -148,7 +136,10 @@ void collator_register_Collator_class( TSRMLS_D )
sizeof Collator_handlers);
/* Collator has no usable clone semantics - ucol_cloneBinary/ucol_openBinary require binary buffer
for which we don't have the place to keep */
+ Collator_handlers.offset = XtOffsetOf(Collator_object, zo);
Collator_handlers.clone_obj = NULL;
+ Collator_handlers.dtor_obj = Collator_objects_dtor;
+ Collator_handlers.free_obj = Collator_objects_free;
/* Declare 'Collator' class properties. */
if( !Collator_ce_ptr )