Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid useless string releases in arginfo.h files #17344

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions Zend/zend_attributes_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Zend/zend_builtin_functions_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions build/gen_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -2742,8 +2742,6 @@ private function getClassConstDeclaration(EvaluatedValue $value, array $allConst
$code .= "#endif\n";
}

$code .= "\tzend_string_release(const_{$constName}_name);\n";

return $code;
}

Expand Down Expand Up @@ -3057,7 +3055,7 @@ private function getString(string $propName): array {
$result = [
"\tzend_string *$nameCode = zend_string_init(\"$propName\", sizeof(\"$propName\") - 1, 1);\n",
$nameCode,
"\tzend_string_release($nameCode);\n"
"\tzend_string_release_ex($nameCode, 1);\n"
];
// If not set, use the current latest version
$allVersions = ALL_PHP_VERSION_IDS;
Expand Down Expand Up @@ -3202,7 +3200,6 @@ public function generateCode(string $invocation, string $nameSuffix, array $allC
} else {
$code .= "\tzend_string *attribute_name_{$escapedAttributeName}_$nameSuffix = zend_string_init_interned(\"" . addcslashes($this->class, "\\") . "\", sizeof(\"" . addcslashes($this->class, "\\") . "\") - 1, 1);\n";
$code .= "\t" . ($this->args ? "zend_attribute *attribute_{$escapedAttributeName}_$nameSuffix = " : "") . "$invocation, attribute_name_{$escapedAttributeName}_$nameSuffix, " . count($this->args) . ");\n";
$code .= "\tzend_string_release(attribute_name_{$escapedAttributeName}_$nameSuffix);\n";
}
foreach ($this->args as $i => $arg) {
$value = EvaluatedValue::createFromExpression($arg->value, null, null, $allConstInfos);
Expand Down
2 changes: 1 addition & 1 deletion ext/bcmath/bcmath_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions ext/curl/curl_file_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading