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

127068 Commits

Author SHA1 Message Date
Dmitry Stogov 4b4b9edcc0 Refactor GC data traversal loops
Previusly, to redce stack usage GC traversed object properties and array
elements in both directions. At first, it seeked backward from the last
element, to find the last refcounted zval. Then, it traversed elements
forward. As result, we had 2 non-spatial memory accesses for each
object/array and usuall 2 expensive CPU cache misses.

Now all the traversal algorithms are refactored to scan elements only in
forward direction. The number of checks and GC stack usage should be the
same. The order of element processing may be differenr, but this
should not be a problem.
2021-11-24 20:38:00 +03:00
Christoph M. Becker 885f935090 Merge branch 'PHP-8.1'
* PHP-8.1:
  "Export" relevant GD macros
2021-11-24 18:26:15 +01:00
Christoph M. Becker a2c0ffb54e Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  "Export" relevant GD macros
2021-11-24 18:25:21 +01:00
Christoph M. Becker 9237055141 "Export" relevant GD macros
For parity with non Windows systems, we should `AC_DEFINE` these macros
so that they are defined in config.w32.h instead of directly passed to
the compiler.  This allows extensions which have ext/gd as dependency
to check for these macros.  E.g. ext/ps does this[1], and fails to
build on Windows, because `HAVE_GD_BUNDLED` isn't defined.

[1] <https://github.com/steinm/ps/blob/RELEASE_1_4_4/ps.c#L34>

Closes GH-7680.
2021-11-24 18:23:28 +01:00
Christoph M. Becker 243966177e Use the standard _WIN32 instead of the custom MSWIN32 in libgd
We're already checking `_WIN32` elsewhere in our bundled libgd, so it
makes no sense to also have a custom `MSWIN32`.

Closes GH-7682.
2021-11-24 15:38:28 +01:00
Christoph M. Becker 7738d8dd02 Drop unused GD defines
These are not used in the bundled libgd, and not used in config.m4
either.

Closes GH-7681.
2021-11-24 15:31:24 +01:00
Nikita Popov 71b2f46798 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix bug #81652
2021-11-24 15:20:38 +01:00
Nikita Popov 51ae5c5397 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix bug #81652
2021-11-24 15:19:33 +01:00
Nikita Popov be271f277e Fix bug #81652
We need to check not only for defs but also for uses of the
variable.
2021-11-24 15:18:31 +01:00
Remi Collet bc9d604430 Merge branch 'PHP-8.1'
* PHP-8.1:
  fix [-Wstrict-prototypes] buid warnings
2021-11-24 14:55:30 +01:00
Remi Collet ef2fd0e5b5 fix [-Wstrict-prototypes] buid warnings 2021-11-24 14:55:11 +01:00
othercorey 108bd4417a Add pdo_sqlite tests for empty filename and in-memory uri (#7662)
pdo_sqlite already supports empty filenames and shared in-memory DBs. Add tests for them.
2021-11-24 14:49:10 +01:00
Dmitry Stogov 067df26344 Use memrchr() when available
On x86_64 glibc memrchr() uses SSE/AVX CPU extensions and works much
faster then naive loop. On x86 32-bit we still use inlined version.

memrchr() is a GNU extension. Its prototype  becomes available when
<string.h> is included with defined _GNU_SOURCE macro. Previously, we
defined it in "php_config.h", but some sources may include <string.h>
befire it. To avod mess we also pass -D_GNU_SOURCE to C compiler.
2021-11-24 16:13:34 +03:00
Christoph M. Becker d312a0c800 [ci skip] We use multiple CI providers, not only Travis
These are already listed at the beginning of the document, so we don't
list them here again to avoid duplication.
2021-11-23 19:12:04 +01:00
Nikita Popov 7cbf4bde3e Merge branch 'PHP-8.1'
* PHP-8.1:
  Add FPM test for php_admin_value doc_root usage
  Fix for bug in file handling refactor.
2021-11-23 18:36:45 +01:00
Jakub Zelenka 435a5aca89 Add FPM test for php_admin_value doc_root usage
Closes GH-7673.
2021-11-23 18:36:04 +01:00
jlbprof 96da46199f Fix for bug in file handling refactor.
While testing the cPanel usage of PHP-FPM, we stumbled on this bug.
Without the fix, the zend_string is corrupted and getting odd filenames

When using FPM we kept getting "No input file specified".

I work for cPanel and we use PHP extensively.
2021-11-23 18:34:48 +01:00
Dmitry Stogov ae5498c929 Fixed typo 2021-11-23 15:34:12 +03:00
Aaron Piotrowski fdd9e0e2da Merge branch 'PHP-8.1' 2021-11-22 18:00:57 -06:00
Aaron Piotrowski 5eead6dfa4 Update bundled boost asm to latest versions 2021-11-22 18:00:43 -06:00
Christoph M. Becker 41d2785f4d Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix #75725: ./configure: detecting RAND_egd
2021-11-22 14:21:57 +01:00
Christoph M. Becker db5ac35a50 Merge branch 'PHP-8.0' into PHP-8.1
Empty merge, since that issue had already been resolved by dropping
that check altogether.
2021-11-22 14:21:23 +01:00
Christoph M. Becker b29e85a0da Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #75725: ./configure: detecting RAND_egd
2021-11-22 14:13:52 +01:00
Дилян Палаузов 60fe575ce3 Fix #75725: ./configure: detecting RAND_egd
Closes GH-7668.
2021-11-22 14:11:07 +01:00
Dmitry Stogov d3f073e8c7 Remove useless check 2021-11-22 13:54:50 +03:00
Tyson Andre 90c16dba16 Merge branch 'PHP-8.1' 2021-11-20 16:53:11 -05:00
Tyson Andre e8283ee88b Merge branch 'PHP-8.0' into PHP-8.1 2021-11-20 16:52:50 -05:00
Tyson Andre 241bd3f454 Fix use after free when WeakMap is modified during field write
(When a value's destructor triggers a resizing or rehashing of the WeakMap)

Closes GH-7671
2021-11-20 16:52:25 -05:00
Tyson Andre b6419f919a Micro-optimizations for WeakMap
Skip WeakMap lookup check used only for debug assertion in non-debug builds

Use the `zend_hash_lookup` helper to optimize adding a WeakMap entry
if the entry doesn't already exist.

Closes GH-7670
2021-11-20 16:23:31 -05:00
Jakub Zelenka 636e54a1cb Merge branch 'PHP-8.1' 2021-11-20 20:44:41 +00:00
Jakub Zelenka 79f0e486fd Merge branch 'PHP-8.0' into PHP-8.1 2021-11-20 20:44:02 +00:00
Jakub Zelenka 2f8407f185 Increase read timeout in FPM process idle test 2021-11-20 20:42:19 +00:00
Jakub Zelenka fc67967190 Increase script sleep in FPM process idle test 2021-11-20 20:42:19 +00:00
Derick Rethans f893b55123 Merge branch 'PHP-8.1' 2021-11-18 13:56:07 +00:00
Derick Rethans e4679ef0c2 Fixed date/diff where the difference in hour is less than 1 2021-11-18 13:55:51 +00:00
Nikita Popov 1845b712e7 Remove commented code in pass1
This has been disabled for a long time, and the whole optimization
is no longer relevant given changes in PHP 8.1
2021-11-18 14:51:55 +01:00
Dmitry Stogov 0e1c7243f6 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed a crash becaeuse of race condition in inheritance cache
2021-11-18 14:22:39 +03:00
Dmitry Stogov 5ab2749263 Fixed a crash becaeuse of race condition in inheritance cache
zend_inheritance_cache_entry.[num_]warnings must be updated before this entry is made visible to other processes
2021-11-18 14:17:36 +03:00
Nikita Popov 3ded2db0d2 Merge branch 'PHP-8.1'
* PHP-8.1:
  Update reflection test after stub change
2021-11-18 11:16:51 +01:00
Nikita Popov 36d2d27980 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Update reflection test after stub change
2021-11-18 11:16:35 +01:00
Nikita Popov e81ad637f4 Update reflection test after stub change 2021-11-18 11:16:13 +01:00
Nikita Popov f29a409cd8 Merge branch 'PHP-8.1'
* PHP-8.1:
  Implement __serialize() and __unserialize() on GMP
2021-11-18 11:13:41 +01:00
Nikita Popov 17ceed9ae7 Implement __serialize() and __unserialize() on GMP
GMP directly implements internal serialize/unserialize handlers
rather than going through the Serializable interface, so it ended
up being missed when adding the new __serialize()/__unserialize()
methods to other classes.

The serialization format is similar to before, but uses hex instead
of decimal encoding and omits the members if not used (which should
be almost always).
2021-11-18 11:11:52 +01:00
Nikita Popov 2791afbf07 Merge branch 'PHP-8.1'
* PHP-8.1:
  Clarify that preg_match_all() cannot return null
2021-11-18 10:37:36 +01:00
Nikita Popov 3ec55d6cbf Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Clarify that preg_match_all() cannot return null
2021-11-18 10:37:18 +01:00
Nikita Popov bc6ec0a109 Clarify that preg_match_all() cannot return null 2021-11-18 10:36:35 +01:00
Nikita Popov 6e982035d0 Merge branch 'PHP-8.1'
* PHP-8.1:
  Skip test under preloading
2021-11-18 09:34:22 +01:00
Nikita Popov 279d6a4f28 Skip test under preloading
In this case we produce additional warnings when preloading
evaluates constants. Possibly we shouldn't be evaluating expressions
with side-effects during preloading, but for now just skip this
test.
2021-11-18 09:33:24 +01:00
Bob Weinand a8b9dbc632 Fix ZEND_HASH_REVERSE_FOREACH_PTR definition 2021-11-18 00:10:28 +01:00
Dmitry Stogov 11b2cfff5b Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed memory leak in Zend/tests/concat_002.phpt introduced by fac78ee760
2021-11-17 18:44:55 +03:00