From 36309981aaa3e84752fd639a19cc9409cc71e3f3 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 7 Jan 2025 20:40:03 +0100 Subject: [PATCH] Use zend_object_alloc() in ext/intl --- ext/intl/calendar/calendar_class.cpp | 4 +--- ext/intl/common/common_enum.cpp | 4 +--- ext/intl/timezone/timezone_class.cpp | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp index 97b21ff8f965..f0582c64d2b2 100644 --- a/ext/intl/calendar/calendar_class.cpp +++ b/ext/intl/calendar/calendar_class.cpp @@ -234,9 +234,7 @@ static void Calendar_objects_free(zend_object *object) /* {{{ Calendar_object_create */ static zend_object *Calendar_object_create(zend_class_entry *ce) { - Calendar_object* intern; - - intern = (Calendar_object*)ecalloc(1, sizeof(Calendar_object) + sizeof(zval) * (ce->default_properties_count - 1)); + Calendar_object* intern = (Calendar_object*)zend_object_alloc(sizeof(Calendar_object), ce); zend_object_std_init(&intern->zo, ce); object_properties_init(&intern->zo, ce); diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp index 58ebeabcb406..4585a60f077a 100644 --- a/ext/intl/common/common_enum.cpp +++ b/ext/intl/common/common_enum.cpp @@ -204,9 +204,7 @@ static zend_object_iterator *IntlIterator_get_iterator( static zend_object *IntlIterator_object_create(zend_class_entry *ce) { - IntlIterator_object *intern; - - intern = (IntlIterator_object*)ecalloc(1, sizeof(IntlIterator_object) + sizeof(zval) * (ce->default_properties_count - 1)); + IntlIterator_object *intern = (IntlIterator_object*)zend_object_alloc(sizeof(IntlIterator_object), ce); zend_object_std_init(&intern->zo, ce); object_properties_init(&intern->zo, ce); diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp index 9d477aaeca83..8d4cd7db007c 100644 --- a/ext/intl/timezone/timezone_class.cpp +++ b/ext/intl/timezone/timezone_class.cpp @@ -335,9 +335,7 @@ static void TimeZone_objects_free(zend_object *object) /* {{{ TimeZone_object_create */ static zend_object *TimeZone_object_create(zend_class_entry *ce) { - TimeZone_object* intern; - - intern = (TimeZone_object*)ecalloc(1, sizeof(TimeZone_object) + sizeof(zval) * (ce->default_properties_count - 1)); + TimeZone_object* intern = (TimeZone_object*)zend_object_alloc(sizeof(TimeZone_object), ce); zend_object_std_init(&intern->zo, ce); object_properties_init(&intern->zo, ce);