Skip to content

Commit

Permalink
Fixed bug #76832 ZendOPcache.MemoryBase periodically deleted by the OS
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed Sep 3, 2018
1 parent 7fde224 commit f26172f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ext/opcache/shared_alloc_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "ZendAccelerator.h"
#include "zend_shared_alloc.h"
#include "zend_accelerator_util_funcs.h"
#include "tsrm_win32.h"
#include <winbase.h>
#include <process.h>
#include <LMCONS.H>
Expand Down Expand Up @@ -159,6 +160,12 @@ static int zend_shared_alloc_reattach(size_t requested_size, char **error_in)
return ALLOC_FAILURE;
}
fclose(fp);

if (0 > win32_utime(mmap_base_file, NULL)) {
err = GetLastError();
zend_win_error_message(ACCEL_LOG_WARNING, mmap_base_file, err);
}

/* Check if the requested address space is free */
if (VirtualQuery(wanted_mapping_base, &info, sizeof(info)) == 0 ||
info.State != MEM_FREE ||
Expand Down

0 comments on commit f26172f

Please sign in to comment.