Skip to content

Commit 259d050

Browse files
committed
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).
1 parent 5ecefd0 commit 259d050

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/intl/breakiterator/breakiterator_class.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ U_CFUNC void breakiterator_object_construct(zval *object,
6969
BreakIterator_object *bio;
7070

7171
BREAKITER_METHOD_FETCH_OBJECT_NO_CHECK; //populate to from object
72-
assert(bio->biter == NULL);
72+
ZEND_ASSERT(bio->biter == NULL);
7373
bio->biter = biter;
7474
}
7575

@@ -203,10 +203,10 @@ static zend_object *BreakIterator_object_create(zend_class_entry *ce)
203203
{
204204
BreakIterator_object* intern;
205205

206-
intern = (BreakIterator_object*)ecalloc(1, sizeof(BreakIterator_object) + sizeof(zval) * (ce->default_properties_count - 1));
206+
intern = (BreakIterator_object*) zend_object_alloc(sizeof(BreakIterator_object), ce);
207207

208208
zend_object_std_init(&intern->zo, ce);
209-
object_properties_init((zend_object*) intern, ce);
209+
object_properties_init(&intern->zo, ce);
210210
breakiterator_object_init(intern);
211211

212212
intern->zo.handlers = &BreakIterator_handlers;

0 commit comments

Comments
 (0)