Skip to content

sync #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 76 commits into from
Nov 21, 2021
Merged

sync #11

Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
7967875
[ci skip] Update NEWS
smalyshev Nov 15, 2021
6f38acf
Safely reassign array in usort()
nikic Nov 16, 2021
2d14ec9
Merge branch 'PHP-8.0' into PHP-8.1
nikic Nov 16, 2021
8a28ab6
Merge branch 'PHP-8.1'
nikic Nov 16, 2021
18a0d46
Safely reassign array in usort()
nikic Nov 16, 2021
1c25c55
Merge branch 'PHP-7.4' into PHP-8.0
nikic Nov 16, 2021
3bea159
Merge branch 'PHP-8.0' into PHP-8.1
nikic Nov 16, 2021
172d469
Merge branch 'PHP-8.1'
nikic Nov 16, 2021
d26965b
Fixed bug #81626
nikic Nov 16, 2021
9e25c4b
Merge branch 'PHP-7.4' into PHP-8.0
nikic Nov 16, 2021
9e5bddd
Merge branch 'PHP-8.0' into PHP-8.1
nikic Nov 16, 2021
4027c11
Merge branch 'PHP-8.1'
nikic Nov 16, 2021
d14a913
[ci skip] Fix news entry for bug #79971
cmb69 Nov 16, 2021
8a20764
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
cmb69 Nov 16, 2021
b963208
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
cmb69 Nov 16, 2021
1641e29
[ci skip] Merge branch 'PHP-8.0' into PHP-8.1
cmb69 Nov 16, 2021
cdcbd6e
[ci skip] Merge branch 'PHP-8.1'
cmb69 Nov 16, 2021
7d92153
7.3.34 might be next
cmb69 Nov 16, 2021
be1cb5a
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
cmb69 Nov 16, 2021
8689248
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
cmb69 Nov 16, 2021
25b0906
[ci skip] Merge branch 'PHP-8.0' into PHP-8.1
cmb69 Nov 16, 2021
c400e6d
[ci skip] Merge branch 'PHP-8.1'
cmb69 Nov 16, 2021
d9ff09a
Extract code for reporting a zend_fetch_class() error
nikic Nov 16, 2021
812df2b
Fix bug #81611
camporter Nov 12, 2021
f51eb15
Merge branch 'PHP-8.1'
nikic Nov 16, 2021
c02aa46
Fix leak when persistent PDO connection fails
nikic Nov 16, 2021
a4da60f
Merge branch 'PHP-8.1'
nikic Nov 16, 2021
fb3e646
OpenBSD ZTS build fix
devnexen Nov 16, 2021
0040571
Merge branch 'PHP-8.0' into PHP-8.1
nikic Nov 17, 2021
372df2d
Merge branch 'PHP-8.1'
nikic Nov 17, 2021
48a65fe
JIT: Fixed memory lieak
dstogov Nov 17, 2021
42ccf93
Merge branch 'PHP-8.0' into PHP-8.1
dstogov Nov 17, 2021
f34a3d3
Merge branch 'PHP-8.1'
dstogov Nov 17, 2021
20fb26e
Add more specific array return type hints for various extensions - pa…
kocsismate Aug 30, 2021
baac970
Add the --generate-optimizer-info option to the help of gen_stub.php
kocsismate Nov 17, 2021
d608319
Merge branch 'PHP-8.1'
kocsismate Nov 17, 2021
fac78ee
JIT: Fixed memory leak
dstogov Nov 17, 2021
61b432c
Merge branch 'PHP-8.0' into PHP-8.1
dstogov Nov 17, 2021
a9db6e7
Merge branch 'PHP-8.1'
dstogov Nov 17, 2021
44e5d25
Fix inheritance of class constants if mutable data used
nikic Nov 16, 2021
24485aa
Merge branch 'PHP-8.1'
nikic Nov 17, 2021
d0ecc83
Assert hash is known when we claim it is
nikic Nov 17, 2021
6641e3b
Fix bug #81630: Don't claim known hash in getTraitAliases()
nikic Nov 17, 2021
aaba000
Merge branch 'PHP-8.1'
nikic Nov 17, 2021
4d4fe76
Fixed bug #81631
nikic Nov 17, 2021
70cb372
Merge branch 'PHP-8.0' into PHP-8.1
nikic Nov 17, 2021
976f569
Merge branch 'PHP-8.1'
nikic Nov 17, 2021
76548e5
Fixed bug #81607 (CE_CACHE allocation with concurrent access)
dstogov Nov 17, 2021
d56ec0a
Merge branch 'PHP-8.1'
dstogov Nov 17, 2021
9dd3e8b
JIT: Fixed memory leak in Zend/tests/concat_002.phpt introduced by fa…
dstogov Nov 17, 2021
8965d6b
Merge branch 'PHP-8.0' into PHP-8.1
dstogov Nov 17, 2021
11b2cff
Merge branch 'PHP-8.1'
dstogov Nov 17, 2021
a8b9dbc
Fix ZEND_HASH_REVERSE_FOREACH_PTR definition
bwoebi Nov 17, 2021
279d6a4
Skip test under preloading
nikic Nov 18, 2021
6e98203
Merge branch 'PHP-8.1'
nikic Nov 18, 2021
bc6ec0a
Clarify that preg_match_all() cannot return null
nikic Nov 18, 2021
3ec55d6
Merge branch 'PHP-8.0' into PHP-8.1
nikic Nov 18, 2021
2791afb
Merge branch 'PHP-8.1'
nikic Nov 18, 2021
17ceed9
Implement __serialize() and __unserialize() on GMP
nikic Nov 18, 2021
f29a409
Merge branch 'PHP-8.1'
nikic Nov 18, 2021
e81ad63
Update reflection test after stub change
nikic Nov 18, 2021
36d2d27
Merge branch 'PHP-8.0' into PHP-8.1
nikic Nov 18, 2021
3ded2db
Merge branch 'PHP-8.1'
nikic Nov 18, 2021
5ab2749
Fixed a crash becaeuse of race condition in inheritance cache
dstogov Nov 18, 2021
0e1c724
Merge branch 'PHP-8.1'
dstogov Nov 18, 2021
1845b71
Remove commented code in pass1
nikic Nov 18, 2021
e4679ef
Fixed date/diff where the difference in hour is less than 1
derickr Nov 18, 2021
f893b55
Merge branch 'PHP-8.1'
derickr Nov 18, 2021
fc67967
Increase script sleep in FPM process idle test
bukka Oct 5, 2021
2f8407f
Increase read timeout in FPM process idle test
bukka Nov 14, 2021
79f0e48
Merge branch 'PHP-8.0' into PHP-8.1
bukka Nov 20, 2021
636e54a
Merge branch 'PHP-8.1'
bukka Nov 20, 2021
b6419f9
Micro-optimizations for WeakMap
TysonAndre Nov 20, 2021
241bd3f
Fix use after free when WeakMap is modified during field write
TysonAndre Nov 20, 2021
e8283ee
Merge branch 'PHP-8.0' into PHP-8.1
TysonAndre Nov 20, 2021
90c16db
Merge branch 'PHP-8.1'
TysonAndre Nov 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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 phpGH-7670
  • Loading branch information
TysonAndre committed Nov 20, 2021
commit b6419f919a556c12de18bd19b6ed53eed589563c
14 changes: 8 additions & 6 deletions Zend/zend_weakrefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ static void zend_weakref_register(zend_object *object, void *payload) {
GC_ADD_FLAGS(object, IS_OBJ_WEAKLY_REFERENCED);

zend_ulong obj_addr = (zend_ulong) object;
zval *zv = zend_hash_index_find(&EG(weakrefs), obj_addr);
if (!zv) {
zend_hash_index_add_new_ptr(&EG(weakrefs), obj_addr, payload);
zval *zv = zend_hash_index_lookup(&EG(weakrefs), obj_addr);
if (Z_TYPE_P(zv) == IS_NULL) {
ZVAL_PTR(zv, payload);
return;
}

Expand Down Expand Up @@ -127,9 +127,11 @@ static void zend_weakref_unregister(zend_object *object, void *payload) {
}

HashTable *ht = ptr;
tagged_ptr = zend_hash_index_find_ptr(ht, (zend_ulong) payload);
ZEND_ASSERT(tagged_ptr && "Weakref not registered?");
ZEND_ASSERT(tagged_ptr == payload);
#if ZEND_DEBUG
void *old_payload = zend_hash_index_find_ptr(ht, (zend_ulong) payload);
ZEND_ASSERT(old_payload && "Weakref not registered?");
ZEND_ASSERT(old_payload == payload);
#endif
zend_hash_index_del(ht, (zend_ulong) payload);
if (zend_hash_num_elements(ht) == 0) {
GC_DEL_FLAGS(object, IS_OBJ_WEAKLY_REFERENCED);
Expand Down