Skip to content

Commit 2b637df

Browse files
authored
Rename php_uri_parser free to destroy (#19888)
This is to fix Windows debug build when it is macro for _free_dbg
1 parent 0bb146f commit 2b637df

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

ext/uri/php_uri.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ ZEND_ATTRIBUTE_NONNULL PHPAPI zend_result php_uri_get_fragment(const uri_interna
167167

168168
ZEND_ATTRIBUTE_NONNULL PHPAPI void php_uri_free(uri_internal_t *internal_uri)
169169
{
170-
internal_uri->parser->free(internal_uri->uri);
170+
internal_uri->parser->destroy(internal_uri->uri);
171171
internal_uri->uri = NULL;
172172
internal_uri->parser = NULL;
173173
efree(internal_uri);
@@ -366,7 +366,7 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 2) PHPAPI void php_uri_instantiate_uri(
366366
}
367367

368368
if (pass_errors_by_ref_and_free(errors_zv, &errors) == FAILURE) {
369-
uri_parser->free(uri);
369+
uri_parser->destroy(uri);
370370
RETURN_THROWS();
371371
}
372372

@@ -1045,7 +1045,7 @@ PHPAPI void php_uri_object_handler_free(zend_object *object)
10451045
{
10461046
uri_object_t *uri_object = uri_object_from_obj(object);
10471047

1048-
uri_object->internal.parser->free(uri_object->internal.uri);
1048+
uri_object->internal.parser->destroy(uri_object->internal.uri);
10491049
zend_object_std_dtor(&uri_object->std);
10501050
}
10511051

@@ -1077,7 +1077,7 @@ PHPAPI zend_result php_uri_parser_register(const php_uri_parser *uri_parser)
10771077
ZEND_ASSERT(uri_parser->parse != NULL);
10781078
ZEND_ASSERT(uri_parser->clone != NULL || strcmp(uri_parser->name, PHP_URI_PARSER_PHP_PARSE_URL) == 0);
10791079
ZEND_ASSERT(uri_parser->to_string != NULL || strcmp(uri_parser->name, PHP_URI_PARSER_PHP_PARSE_URL) == 0);
1080-
ZEND_ASSERT(uri_parser->free != NULL);
1080+
ZEND_ASSERT(uri_parser->destroy != NULL);
10811081

10821082
zend_result result = zend_hash_add_ptr(&uri_parsers, key, (void *) uri_parser) != NULL ? SUCCESS : FAILURE;
10831083

ext/uri/php_uri_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ typedef struct php_uri_parser {
119119
zend_string *(*to_string)(void *uri, php_uri_recomposition_mode recomposition_mode, bool exclude_fragment);
120120

121121
/**
122-
* Frees the provided URI.
122+
* Destroy (free) the provided URI.
123123
*
124124
* @param uri The URI to free. Must do nothing if NULL.
125125
*/
126-
void (*free)(void *uri);
126+
void (*destroy)(void *uri);
127127

128128
struct {
129129
php_uri_property_handler scheme;

ext/uri/uri_parser_php_parse_url.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static void *uri_parser_php_parse_url_parse(const char *uri_str, size_t uri_str_
154154
return url;
155155
}
156156

157-
static void uri_parser_php_parse_url_free(void *uri)
157+
static void uri_parser_php_parse_url_destroy(void *uri)
158158
{
159159
php_url *parse_url_uri = uri;
160160

@@ -170,7 +170,7 @@ const php_uri_parser php_uri_parser_php_parse_url = {
170170
.parse = uri_parser_php_parse_url_parse,
171171
.clone = NULL,
172172
.to_string = NULL,
173-
.free = uri_parser_php_parse_url_free,
173+
.destroy = uri_parser_php_parse_url_destroy,
174174
{
175175
.scheme = {.read = uri_parser_php_parse_url_scheme_read, .write = NULL},
176176
.username = {.read = uri_parser_php_parse_url_username_read, .write = NULL},

ext/uri/uri_parser_rfc3986.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static void *php_uri_parser_rfc3986_memory_manager_reallocarray(UriMemoryManager
4040
return safe_erealloc(ptr, nmemb, size, 0);
4141
}
4242

43-
static void php_uri_parser_rfc3986_memory_manager_free(UriMemoryManager *memory_manager, void *ptr)
43+
static void php_uri_parser_rfc3986_memory_manager_destroy(UriMemoryManager *memory_manager, void *ptr)
4444
{
4545
efree(ptr);
4646
}
@@ -50,7 +50,7 @@ static const UriMemoryManager php_uri_parser_rfc3986_memory_manager = {
5050
.calloc = php_uri_parser_rfc3986_memory_manager_calloc,
5151
.realloc = php_uri_parser_rfc3986_memory_manager_realloc,
5252
.reallocarray = php_uri_parser_rfc3986_memory_manager_reallocarray,
53-
.free = php_uri_parser_rfc3986_memory_manager_free,
53+
.free = php_uri_parser_rfc3986_memory_manager_destroy,
5454
.userData = NULL,
5555
};
5656

@@ -593,7 +593,7 @@ ZEND_ATTRIBUTE_NONNULL static zend_string *php_uri_parser_rfc3986_to_string(void
593593
return uri_string;
594594
}
595595

596-
static void php_uri_parser_rfc3986_free(void *uri)
596+
static void php_uri_parser_rfc3986_destroy(void *uri)
597597
{
598598
php_uri_parser_rfc3986_uris *uriparser_uris = uri;
599599

@@ -612,7 +612,7 @@ const php_uri_parser php_uri_parser_rfc3986 = {
612612
.parse = php_uri_parser_rfc3986_parse,
613613
.clone = php_uri_parser_rfc3986_clone,
614614
.to_string = php_uri_parser_rfc3986_to_string,
615-
.free = php_uri_parser_rfc3986_free,
615+
.destroy = php_uri_parser_rfc3986_destroy,
616616
{
617617
.scheme = {.read = php_uri_parser_rfc3986_scheme_read, .write = php_uri_parser_rfc3986_scheme_write},
618618
.username = {.read = php_uri_parser_rfc3986_username_read, .write = NULL},

ext/uri/uri_parser_whatwg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ static zend_string *php_uri_parser_whatwg_to_string(void *uri, php_uri_recomposi
614614
return smart_str_extract(&uri_str);
615615
}
616616

617-
static void php_uri_parser_whatwg_free(void *uri)
617+
static void php_uri_parser_whatwg_destroy(void *uri)
618618
{
619619
lxb_url_t *lexbor_uri = uri;
620620

@@ -626,7 +626,7 @@ const php_uri_parser php_uri_parser_whatwg = {
626626
.parse = php_uri_parser_whatwg_parse,
627627
.clone = php_uri_parser_whatwg_clone,
628628
.to_string = php_uri_parser_whatwg_to_string,
629-
.free = php_uri_parser_whatwg_free,
629+
.destroy = php_uri_parser_whatwg_destroy,
630630
{
631631
.scheme = {.read = php_uri_parser_whatwg_scheme_read, .write = php_uri_parser_whatwg_scheme_write},
632632
.username = {.read = php_uri_parser_whatwg_username_read, .write = php_uri_parser_whatwg_username_write},

0 commit comments

Comments
 (0)