com php-src: We can re-use the already existing EG(windows_ version_info) here and save a little bit of memory too!: ext/standard/info.c
| From: | Kalle Sommer Nielsen | Date: | Sun, 29 Mar 2015 07:47:14 +0000 |
| Subject: | com php-src: We can re-use the already existing EG(windows_ version_info) here and save a little bit of memory too!: ext/standard/info.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85918@lists.php.net to get a copy of this message | ||
Commit: de2d244f8e4be716b577482eff1ee99cac53702a
Author: Kalle Sommer Nielsen <kalle@php.net> Sun, 29 Mar 2015 09:47:14 +0200
Parents: c48611772dde23b98238ba295c7ddf836fa8ba76
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=de2d244f8e4be716b577482eff1ee99cac53702a
Log:
We can re-use the already existing EG(windows_version_info) here and save a little bit of memory
too!
Changed paths:
M ext/standard/info.c
Diff:
diff --git a/ext/standard/info.c b/ext/standard/info.c
index e4447be..9490aae 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -291,21 +291,14 @@ PHPAPI zend_string *php_info_html_esc(char *string)
char* php_get_windows_name()
{
- OSVERSIONINFOEX osvi;
+ OSVERSIONINFOEX osvi = EG(windows_version_info);
SYSTEM_INFO si;
PGNSI pGNSI;
PGPI pGPI;
- BOOL bOsVersionInfoEx;
DWORD dwType;
char *major = NULL, *sub = NULL, *retval;
ZeroMemory(&si, sizeof(SYSTEM_INFO));
- ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
-
- if (!(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi))) {
- return NULL;
- }
pGNSI = (PGNSI) GetProcAddress(GetModuleHandle("kernel32.dll"),
"GetNativeSystemInfo");
if(NULL != pGNSI) {