Use zend_object_alloc() in ext/intl (#17392)

This commit is contained in:
Niels Dossche 2025-01-07 21:24:24 +01:00 committed by GitHub
parent cc4402b6cb
commit fcea7af9d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 9 deletions

View file

@ -234,9 +234,7 @@ static void Calendar_objects_free(zend_object *object)
/* {{{ Calendar_object_create */ /* {{{ Calendar_object_create */
static zend_object *Calendar_object_create(zend_class_entry *ce) static zend_object *Calendar_object_create(zend_class_entry *ce)
{ {
Calendar_object* intern; Calendar_object* intern = (Calendar_object*)zend_object_alloc(sizeof(Calendar_object), ce);
intern = (Calendar_object*)ecalloc(1, sizeof(Calendar_object) + sizeof(zval) * (ce->default_properties_count - 1));
zend_object_std_init(&intern->zo, ce); zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce); object_properties_init(&intern->zo, ce);

View file

@ -204,9 +204,7 @@ static zend_object_iterator *IntlIterator_get_iterator(
static zend_object *IntlIterator_object_create(zend_class_entry *ce) static zend_object *IntlIterator_object_create(zend_class_entry *ce)
{ {
IntlIterator_object *intern; IntlIterator_object *intern = (IntlIterator_object*)zend_object_alloc(sizeof(IntlIterator_object), ce);
intern = (IntlIterator_object*)ecalloc(1, sizeof(IntlIterator_object) + sizeof(zval) * (ce->default_properties_count - 1));
zend_object_std_init(&intern->zo, ce); zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce); object_properties_init(&intern->zo, ce);

View file

@ -335,9 +335,7 @@ static void TimeZone_objects_free(zend_object *object)
/* {{{ TimeZone_object_create */ /* {{{ TimeZone_object_create */
static zend_object *TimeZone_object_create(zend_class_entry *ce) static zend_object *TimeZone_object_create(zend_class_entry *ce)
{ {
TimeZone_object* intern; TimeZone_object* intern = (TimeZone_object*)zend_object_alloc(sizeof(TimeZone_object), ce);
intern = (TimeZone_object*)ecalloc(1, sizeof(TimeZone_object) + sizeof(zval) * (ce->default_properties_count - 1));
zend_object_std_init(&intern->zo, ce); zend_object_std_init(&intern->zo, ce);
object_properties_init(&intern->zo, ce); object_properties_init(&intern->zo, ce);