Skip to content

Commit d81d73f

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 3178a99 commit d81d73f

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
@@ -53,7 +53,6 @@ zend_smm_shared_globals *smm_shared_globals;
5353
static MUTEX_T zts_lock;
5454
#endif
5555
int lock_file;
56-
static char lockfile_name[MAXPATHLEN];
5756
#endif
5857

5958
static const zend_shared_memory_handler_entry handler_table[] = {
@@ -81,6 +80,7 @@ void zend_shared_alloc_create_lock(const char *lockfile_path)
8180
zts_lock = tsrm_mutex_alloc();
8281
#endif
8382

83+
char lockfile_name[MAXPATHLEN];
8484
snprintf(lockfile_name, sizeof(lockfile_name), "%s/%sXXXXXX", lockfile_path, SEM_FILENAME_PREFIX);
8585
lock_file = mkstemp(lockfile_name);
8686
if (lock_file == -1) {

0 commit comments

Comments
 (0)