Skip to content

Commit c10afa9

Browse files
authored
Simplify curl gc handlers (#18227)
Since these objects are final and have no dynamic properties, we don't have to build a property table.
1 parent 1f6fdde commit c10afa9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ext/curl/interface.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,9 @@ static HashTable *curl_get_gc(zend_object *object, zval **table, int *n)
546546

547547
zend_get_gc_buffer_use(gc_buffer, table, n);
548548

549-
return zend_std_get_properties(object);
549+
/* CurlHandle can never have properties as it's final and has strict-properties on.
550+
* Avoid building a hash table. */
551+
return NULL;
550552
}
551553

552554
zend_result curl_cast_object(zend_object *obj, zval *result, int type)

ext/curl/multi.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,9 @@ static HashTable *curl_multi_get_gc(zend_object *object, zval **table, int *n)
594594

595595
zend_get_gc_buffer_use(gc_buffer, table, n);
596596

597-
return zend_std_get_properties(object);
597+
/* CurlMultiHandle can never have properties as it's final and has strict-properties on.
598+
* Avoid building a hash table. */
599+
return NULL;
598600
}
599601

600602
static zend_object_handlers curl_multi_handlers;

0 commit comments

Comments
 (0)