History log of /PHP-8.2/Zend/zend_hash.c (Results 1 – 25 of 493)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272dc9a0 21-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Merge branch 'PHP-8.1' into PHP-8.2

* PHP-8.1:
Fix GH-11716: cli server crashes on SIGINT when compiled with ZEND_RC_DEBUG=1


# af77d3b8 21-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-11716: cli server crashes on SIGINT when compiled with ZEND_RC_DEBUG=1

Closes GH-11757.

# 8f66b67c 10-May-2023 Ilija Tovilo

Fix compilation for PHP 8.1

Accidentally introduced in 175ff603c3a8ae9dd3e6ccb3fc3081b06263f989. arData was
not part of an anonymous union.

# 53558ffc 10-May-2023 Bob Weinand

Merge branch 'PHP-8.1' into PHP-8.2


# 975d28e2 10-May-2023 Bob Weinand

Fix GH-11222: foreach by-ref may jump over keys during a rehash

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>

# 66924774 10-May-2023 Ilija Tovilo

Merge branch 'PHP-8.1' into PHP-8.2

* PHP-8.1:
Fix compilation error on old GCC versions


# 175ff603 09-May-2023 Amedeo Baragiola

Fix compilation error on old GCC versions

In older versions of GCC (<=4.5) designated initializers would not accept member
names nested inside anonymous structures. Instead, we need to u

Fix compilation error on old GCC versions

In older versions of GCC (<=4.5) designated initializers would not accept member
names nested inside anonymous structures. Instead, we need to use a positional
member wrapped in {}.

Fixes GH-11063
Closes GH-11212

show more ...

# cfbb47b5 05-May-2023 Bob Weinand

Merge branch 'PHP-8.1' into PHP-8.2


# 05bd1423 05-May-2023 Bob Weinand

Fix GH-11189: Exceeding memory limit in zend_hash_do_resize leaves the array in an invalid state

There are more places in zend_hash.c where the resize happened after some values on the HashT

Fix GH-11189: Exceeding memory limit in zend_hash_do_resize leaves the array in an invalid state

There are more places in zend_hash.c where the resize happened after some values on the HashTable struct were set.
I reordered them all, but writing a test for these would rely on the particular amount of bytes allocated at given points in time.

show more ...

# d8940807 13-Jan-2023 Arnaud Le Blanc

Merge branch 'PHP-8.1' into PHP-8.2

* PHP-8.1:
Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242)
GC fiber unfinished executions (#9810)


# 0f7625c4 13-Jan-2023 Arnaud Le Blanc

Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242)

zend_hash allocates a hash table twice as big as nTableSize
(HT_HASH_SIZE(HT_SIZE_TO_MASK(nTableSize)) == nTableSize

Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242)

zend_hash allocates a hash table twice as big as nTableSize
(HT_HASH_SIZE(HT_SIZE_TO_MASK(nTableSize)) == nTableSize*2), so HT_MAX_SIZE
must be half the max table size or less.

Fixes GH-10240

show more ...

# 86456574 02-Nov-2022 George Peter Banyard

Fix performance degradation introduced in c2547ab7dc67646e287d430e44798cb9f327cf21

After discussing with someone, our current running theory is that the local
variable forces the compile

Fix performance degradation introduced in c2547ab7dc67646e287d430e44798cb9f327cf21

After discussing with someone, our current running theory is that the local
variable forces the compiler to reserve an additional register for the whole
lifespan of the function. Dropping it and just loading the value should restore
the previous code generation.

Closes GH-9876

show more ...

# 3a843f95 24-Jul-2022 dixyes

Windows arm64 zend and standard extension support

* Port zend_cpuid for windows arm64
* Fix zend_atomic windows arm64 build
* Fix windows arm64 multiply
* Enable arm64 neon for w

Windows arm64 zend and standard extension support

* Port zend_cpuid for windows arm64
* Fix zend_atomic windows arm64 build
* Fix windows arm64 multiply
* Enable arm64 neon for windows in standard extension
* Enable arm64 neon for windows in zend_hash.c
* Workaround for msvc arm64 optimization bug

Closes GH-9115.

show more ...

# faa83f2f 04-Aug-2022 George Peter Banyard

Convert some macros to zend_always_inline functions (#8288)

This doesn't have an effect really, but humans and IDEs can struggle to see through the macro soup when they first interact with P

Convert some macros to zend_always_inline functions (#8288)

This doesn't have an effect really, but humans and IDEs can struggle to see through the macro soup when they first interact with PHP's source code.

Moreover, this reduces some of the macro expansion hell when they appear in compiler warnings.

show more ...

# 75a9a5f3 11-Jul-2022 Tim Düsterhus

Add `zend_array_to_list()` (#8976)

* Add zend_array_to_list()

* Use `zend_array_to_list()` in `PHP_FUNCTION(array_values)`

# c2547ab7 20-Apr-2022 George Peter Banyard

Add some const qualifiers in zend_string/hash (#8304)

Co-authored-by: Levi Morrison <morrison.levi@gmail.com>

# 2ab05da9 04-Apr-2022 Dmitry Stogov

Merge branch 'PHP-8.1'

* PHP-8.1:
Fix arsort() crash on recursion


# 14fddd17 04-Apr-2022 Dmitry Stogov

Fix arsort() crash on recursion

Fixes oss-fuzz #46315

# b9e895bc 31-Mar-2022 Max Kellermann

Replace memcmp() with zend_string functions (#8216)

* ext/oci8: use zend_string_equals()

Eliminate duplicate code.

* main/php_variables: use zend_string_equals_literal()

Replace memcmp() with zend_string functions (#8216)

* ext/oci8: use zend_string_equals()

Eliminate duplicate code.

* main/php_variables: use zend_string_equals_literal()

Eliminate duplicate code.

* Zend/zend_string: add zend_string_equals_cstr()

Allows eliminating duplicate code.

* Zend, ext/{opcache,standard}, main/output: use zend_string_equals_cstr()

Eliminate duplicate code.

* Zend/zend_string: add zend_string_starts_with()

* ext/{opcache,phar,spl,standard}: use zend_string_starts_with()

This adds missing length checks to several callers, e.g. in
cache_script_in_shared_memory(). This is important when the
zend_string is shorter than the string parameter, when memcmp()
happens to check backwards; this can result in an out-of-bounds memory
access.

show more ...

# eee3b1d9 24-Dec-2021 Dmitry Stogov

Bucket->key must be removed before destructor call, because destructor may update the same HashTable.

Fixes oss-fuzz #42894

# 5d6bc250 22-Dec-2021 Dmitry Stogov

Reset Bucket->key of deleted HastTable elemets to NULL.

This allows elimination of some Z_ISUNDEF(Bucket->val) checks.

# d3f073e8 22-Nov-2021 Dmitry Stogov

Remove useless check

# aaba0000 17-Nov-2021 Nikita Popov

Merge branch 'PHP-8.1'

* PHP-8.1:
Fix bug #81630: Don't claim known hash in getTraitAliases()
Assert hash is known when we claim it is


# d0ecc83a 17-Nov-2021 Nikita Popov

Assert hash is known when we claim it is

# 90b7bde6 03-Nov-2021 Dmitry Stogov

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
(ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
(packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
- sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
- zend_hash_sort_ex() may require converting packed arrays to hash.

show more ...

12345678910>>...20