1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 06:51:18 +02:00
Commit Graph

70 Commits

Author SHA1 Message Date
Niels Dossche 9c59d22a7b Fix GH-11336: php still tries to unlock the shared memory ZendSem with opcache.file_cache_only=1 but it was never locked
I chose to check for the value of lock_file instead of checking the
file_cache_only, because it is probably a little bit faster and we're
going to access the lock_file variable anyway. It's also more generic.

Closes GH-11341.
2023-05-30 17:32:02 +02:00
KoudelkaB 8946b7b141 Access violation when ALLOC_FALLBACK fixed
Close GH-11312
2023-05-25 11:01:17 +02:00
nielsdos 6267601f84 Fix allocation loop in zend_shared_alloc_startup()
The break is outside the if, so if it succeeds or not this will always
stop after the first loop iteration instead of trying more allocators if
the first one fails.

Closes GH-11306.
2023-05-24 20:09:14 +02:00
Patrick Allaert aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
KsaR 01b3fc03c3 Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Dmitry Stogov 4b79dba932 Added Inheritance Cache.
This is a new transparent technology that eliminates overhead of PHP class inheritance.

PHP  classes are compiled and cached (by opcahce) separately, however their "linking" was done at run-time - on each request. The process of "linking" may involve a number of compatibility checks and borrowing methods/properties/constants form parent and traits. This takes significant time, but the result is the same on each request.

Inheritance Cache performs "linking" for unique set of all the depending classes (parent, interfaces, traits, property types, method types involved into compatibility checks) once and stores result in opcache shared memory. As a part of the this patch, I removed limitations for immutable classes (unresolved constants, typed properties and covariant type checks). So now all classes stored in opcache are "immutable". They may be lazily loaded into process memory, if necessary, but this usually occurs just once (on first linking).

The patch shows 8% improvement on Symphony "Hello World" app.
2021-02-09 22:53:57 +03:00
Nikita Popov 3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Nikita Popov 2dc228040a Use zend_accel_error_noreturn in more places
Missed the place in accelerator_blacklist that was the actual
motivation here...
2020-10-19 16:59:00 +02:00
Nikita Popov aa8d70f309 Merge branch 'PHP-7.4' 2019-06-28 09:19:49 +02:00
Nikita Popov a78adce5cb Free ZTS lock in opcache
For some reason this only shows up as a leak when using phpdbg.
2019-06-28 09:18:14 +02:00
Anatol Belski f4628436df Fix VirtualProtect memory size
As otherwise it would remove executable flag from JIT memory

Thanks Dmitry for the hint :)
2019-04-11 15:46:46 +02:00
Nikita Popov 9db2efe283 Merge branch 'PHP-7.4' 2019-04-10 15:31:24 +02:00
Nikita Popov eb8c07fe2f Support VirtualProtect for opcache.protect_memory
Don't enable this on AppVeyor yet, as there is still an open
issue in phar.
2019-04-10 15:31:18 +02:00
Dmitry Stogov 9a06876072 Added JIT compiler for x86 and x86_64 2019-04-01 10:27:11 +03:00
Dmitry Stogov 26e26969c1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Avoid dependency on "struct flock" fields order.
2019-02-12 10:22:13 +03:00
Dmitry Stogov 470f5891d4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Avoid dependency on "struct flock" fields order.
2019-02-12 10:21:59 +03:00
Dmitry Stogov 9222702633 Avoid dependency on "struct flock" fields order. 2019-02-12 10:15:16 +03:00
Dmitry Stogov da919a8b65 Remove copyright years. 2019-02-05 10:33:28 +03:00
Zeev Suraski 9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Zeev Suraski 67e0138c0d Future-proof email addresses... 2018-11-01 18:30:28 +02:00
Dmitry Stogov f33da6f338 Don't use request heap at shutdown 2018-10-25 19:24:39 +03:00
Dmitry Stogov d57cd36e47 Immutable clases and op_arrays.
Squashed commit of the following:

commit cd0c36c3f9
Merge: 4740dabb84 ad6738e886
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:43:38 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove the "auto" encoding
      Fixed bug #77025
      Add vtbls for EUC-TW encoding

commit 4740dabb84
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:12:28 2018 +0300

    Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes.

commit ad7a78b253
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:46:30 2018 +0300

    Added comment

commit 0276ea5187
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:42:43 2018 +0300

    Added type cast

commit c63fc5d5f1
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:36:51 2018 +0300

    Moved static class members initialization into the proper place.

commit b945548e93
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:21:03 2018 +0300

    Removed redundand assertion

commit d5a4108840
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:19:13 2018 +0300

    Removed duplicate code

commit 8dadca8864
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:05:43 2018 +0300

    Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros.

commit 9ef07c88bd
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:48:29 2018 +0300

    typo

commit a06f0f3d3a
Merge: 94099586ec 3412345ffe
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:47:07 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove unused variable makefile_am_files
      Classify object handlers are required/optional
      Add support for getting SKIP_TAGSTART and SKIP_WHITE options
      Remove some obsolete config_vars.mk occurrences
      Remove bsd_converted from .gitignore
      Remove configuration parser and scanners ignores
      Remove obsolete buildconf.stamp from .gitignore
      [ci skip] Add magicdata.patch exception to .gitignore
      Remove outdated ext/spl/examples items from .gitignore
      Remove unused test.inc in ext/iconv/tests

commit 94099586ec
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 15 23:34:01 2018 +0300

    Immutable clases and op_arrays
2018-10-17 15:52:50 +03:00
Dmitry Stogov 3a3840a847 Avoid useless store and checks in xlat_table. 2018-09-26 17:05:49 +03:00
Peter Kokot eff22dc511 Remove AC_HEADER_DIRENT
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_DIRENT`.

This macro checks which header defines the `DIR` type. If `<dirent.h>`
is available it defines the `HAVE_DIRENT_H` symbol. Since the `<dirent.h>`
header is already checked in the `configure.ac`, this check is not needed
anymore. This macro also additionally checks for SCO Xenix (discontinued,
latest release 1989) dir and x libraries. [2]

Commit 6ed790685f introduced also
`<sys/dir.h>`. This header exists from times of UNIX System V and
provided definition of DIR type on these systems such as 4.3BSD.
Today `<sys/dir.h>` is kept for backwards compatibility and includes
the `<dirent.h>` on current systems. With `dirent.h>` present this
include is no longer required.

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html

Remove unused dirent.h includes
2018-09-04 12:01:24 +02:00
Xinchen Hui a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui 7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Dmitry Stogov 9f1e970058 Reduce number of hash collisions during dulicate address detection. 2017-12-11 18:16:54 +03:00
Dmitry Stogov c23ffaa211 We don't have to use "persistent" heap with PHP-7 HashTable(s). 2017-06-29 09:24:07 +03:00
Tom Van Looy 04fb3f28ff Remove superfluous semicolons 2017-06-26 00:23:25 +02:00
Dmitry Stogov c16f954ff1 Clear alocated memory blocks, only if this is really necessary. 2017-06-21 10:37:54 +03:00
Sammy Kaye Powers 9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Xinchen Hui 3440054ca8 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed format

Conflicts:
	ext/opcache/zend_shared_alloc.c
2016-06-24 21:14:02 +08:00
Xinchen Hui 53de1c2830 Fixed format 2016-06-24 21:13:04 +08:00
Dmitry Stogov 1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Fatih ACAR d54eafb349 make opcache lockfile path configurable
Signed-off-by: William Dauchy <william@gandi.net>
Signed-off-by: Baptiste Daroussin <baptiste.daroussin@gandi.net>
Signed-off-by: Fatih Acar <fatih.acar@gandi.net>
2016-04-06 13:29:52 +02:00
Xinchen Hui 9fc0517328 Fixed another segfault with file_cache_only now 2016-03-01 10:50:56 +08:00
Xinchen Hui 8c053d44e4 Fixed segfault with file_cache_only 2016-02-28 11:50:06 +08:00
Dmitry Stogov 6842a3674d Fixed possible crash at PCRE on MSHUTDOWN 2016-02-24 23:46:11 +03:00
Lior Kaplan ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan 49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Anatol Belski ffb5d0aca3 Implemented file_cache_fallback mechanism
which is essential as an attempt to fix the "failed to reattach"
error on Windows. If file_cache is enabled, Opcache will
automaticaly switch to file_cache_only mode in the case a process
failed to map the shared segment at the required address. The
important small part of the SHM will still be mapped, which
allows information exchange between normal processes using SHM
and those using the fallback mechanism.

This is based on Dmitry's, Matt's and mine ideas. So many thanks for
support!
2015-10-09 23:47:59 +02:00
Dmitry Stogov 89aa1b7392 Ensure proper data alignment 2015-08-31 13:56:42 +03:00
Dmitry Stogov 869f662cdd Use better zend_hash_* functions 2015-06-05 13:54:57 +03:00
Dmitry Stogov 3abde43231 Added experimental (disabled by default) file based opcode cache. 2015-05-06 23:46:49 +03:00
Xinchen Hui 0a8f28b432 Fixed bug #68677 (Use After Free in OPcache)
(cherry picked from commit 777c39f404)
2015-04-01 01:24:16 +03:00
Xinchen Hui fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui 73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Xinchen Hui 777c39f404 Fixed #68677 2015-01-08 16:32:20 +08:00
Anatol Belski bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski c00424e427 bring back all the TSRMLS_FETCH() stuff
for better comparability with the mainstream
2014-10-15 09:37:55 +02:00