summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-08-14 16:56:25 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-08-25 13:11:43 +0200
commit259d050a39cf24c21237055598b5c5a52aea2565 (patch)
tree627ad4db4a95c05b08bea317d3fb22716eaa8deb
parent5ecefd07608df0fe706eb9cc829f4d26cc44972b (diff)
downloadphp-git-259d050a39cf24c21237055598b5c5a52aea2565.tar.gz
Clean up BreakIterator create_object handler
Use standard zend_object_alloc() function and fix the object_init_properties() call (which works out okay because there are no properties).
-rw-r--r--ext/intl/breakiterator/breakiterator_class.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp
index 2114ada558..3f236db2d4 100644
--- a/ext/intl/breakiterator/breakiterator_class.cpp
+++ b/ext/intl/breakiterator/breakiterator_class.cpp
@@ -69,7 +69,7 @@ U_CFUNC void breakiterator_object_construct(zval *object,
BreakIterator_object *bio;
BREAKITER_METHOD_FETCH_OBJECT_NO_CHECK; //populate to from object
- assert(bio->biter == NULL);
+ ZEND_ASSERT(bio->biter == NULL);
bio->biter = biter;
}
@@ -203,10 +203,10 @@ static zend_object *BreakIterator_object_create(zend_class_entry *ce)
{
BreakIterator_object* intern;
- intern = (BreakIterator_object*)ecalloc(1, sizeof(BreakIterator_object) + sizeof(zval) * (ce->default_properties_count - 1));
+ intern = (BreakIterator_object*) zend_object_alloc(sizeof(BreakIterator_object), ce);
zend_object_std_init(&intern->zo, ce);
- object_properties_init((zend_object*) intern, ce);
+ object_properties_init(&intern->zo, ce);
breakiterator_object_init(intern);
intern->zo.handlers = &BreakIterator_handlers;