From 795eb90b925993468379c18618f7e6ea77997e92 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 1 Apr 2025 23:42:23 +0200 Subject: [PATCH] Simplify curl gc handlers Since these objects are final and have no dynamic properties, we don't have to build a property table. --- ext/curl/interface.c | 4 +++- ext/curl/multi.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 5be9327566b19..aebb336378bc0 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -546,7 +546,9 @@ static HashTable *curl_get_gc(zend_object *object, zval **table, int *n) zend_get_gc_buffer_use(gc_buffer, table, n); - return zend_std_get_properties(object); + /* CurlHandle can never have properties as it's final and has strict-properties on. + * Avoid building a hash table. */ + return NULL; } zend_result curl_cast_object(zend_object *obj, zval *result, int type) diff --git a/ext/curl/multi.c b/ext/curl/multi.c index 3d97b581be764..fd0a8316646f6 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -594,7 +594,9 @@ static HashTable *curl_multi_get_gc(zend_object *object, zval **table, int *n) zend_get_gc_buffer_use(gc_buffer, table, n); - return zend_std_get_properties(object); + /* CurlMultiHandle can never have properties as it's final and has strict-properties on. + * Avoid building a hash table. */ + return NULL; } static zend_object_handlers curl_multi_handlers;