Skip to content

Commit 04733fe

Browse files
committed
ext/opcache/zend_shared_alloc: make lockfile_name a local variable
The variable is only used once inside zend_shared_alloc_create_lock() and the value is never needed again. Let's save a few kilobytes of memory by making the buffer local.
1 parent 96ad215 commit 04733fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/opcache/zend_shared_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ zend_smm_shared_globals *smm_shared_globals;
6060
static MUTEX_T zts_lock;
6161
#endif
6262
int lock_file;
63-
static char lockfile_name[MAXPATHLEN];
6463
#endif
6564

6665
static const zend_shared_memory_handler_entry handler_table[] = {
@@ -100,6 +99,7 @@ void zend_shared_alloc_create_lock(const char *lockfile_path)
10099
return;
101100
#endif
102101

102+
char lockfile_name[MAXPATHLEN];
103103
snprintf(lockfile_name, sizeof(lockfile_name), "%s/%sXXXXXX", lockfile_path, SEM_FILENAME_PREFIX);
104104
lock_file = mkstemp(lockfile_name);
105105
if (lock_file == -1) {

0 commit comments

Comments
 (0)