Skip to content

Commit fcea7af

Browse files
authored
Use zend_object_alloc() in ext/intl (#17392)
1 parent cc4402b commit fcea7af

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

ext/intl/calendar/calendar_class.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,7 @@ static void Calendar_objects_free(zend_object *object)
234234
/* {{{ Calendar_object_create */
235235
static zend_object *Calendar_object_create(zend_class_entry *ce)
236236
{
237-
Calendar_object* intern;
238-
239-
intern = (Calendar_object*)ecalloc(1, sizeof(Calendar_object) + sizeof(zval) * (ce->default_properties_count - 1));
237+
Calendar_object* intern = (Calendar_object*)zend_object_alloc(sizeof(Calendar_object), ce);
240238

241239
zend_object_std_init(&intern->zo, ce);
242240
object_properties_init(&intern->zo, ce);

ext/intl/common/common_enum.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,7 @@ static zend_object_iterator *IntlIterator_get_iterator(
204204

205205
static zend_object *IntlIterator_object_create(zend_class_entry *ce)
206206
{
207-
IntlIterator_object *intern;
208-
209-
intern = (IntlIterator_object*)ecalloc(1, sizeof(IntlIterator_object) + sizeof(zval) * (ce->default_properties_count - 1));
207+
IntlIterator_object *intern = (IntlIterator_object*)zend_object_alloc(sizeof(IntlIterator_object), ce);
210208

211209
zend_object_std_init(&intern->zo, ce);
212210
object_properties_init(&intern->zo, ce);

ext/intl/timezone/timezone_class.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,7 @@ static void TimeZone_objects_free(zend_object *object)
335335
/* {{{ TimeZone_object_create */
336336
static zend_object *TimeZone_object_create(zend_class_entry *ce)
337337
{
338-
TimeZone_object* intern;
339-
340-
intern = (TimeZone_object*)ecalloc(1, sizeof(TimeZone_object) + sizeof(zval) * (ce->default_properties_count - 1));
338+
TimeZone_object* intern = (TimeZone_object*)zend_object_alloc(sizeof(TimeZone_object), ce);
341339

342340
zend_object_std_init(&intern->zo, ce);
343341
object_properties_init(&intern->zo, ce);

0 commit comments

Comments
 (0)