Commit graph

510 commits

Author SHA1 Message Date
Dmitry Stogov
76d8f3923e Revert HASH_FLAG_INITIALIZED into HASH_FLAG_UNINITIALIZED. 2018-12-28 11:22:18 +03:00
Dmitry Stogov
d6f4652255 Added specialized code for small arrays 2018-12-20 17:55:01 +03:00
Dmitry Stogov
dddf3c501e Added specialized code for small arrays 2018-12-19 17:40:34 +03:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Zeev Suraski
54dc07f3dc Update email addresses. We're still @Zend, but future proofing it... 2018-11-01 17:20:07 +02:00
Pedro Magalhães
c2c202193a Use HT_MIN_SIZE when duplicating an empty array 2018-10-05 12:14:42 +02:00
Dmitry Stogov
27b0fecd2e Turn zend_hash_exists() into inline function 2018-09-19 13:55:53 +03:00
Nikita Popov
dfa166e7ed Remove unused ZEND_FILE_LINE in i_zval_ptr_dtor 2018-09-16 17:16:26 +02:00
Dmitry Stogov
7eb255e9db Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76800 (foreach inconsistent if array modified during loop)
2018-09-14 10:33:32 +03:00
Dmitry Stogov
17c7b71057 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #76800 (foreach inconsistent if array modified during loop)
2018-09-14 10:32:31 +03:00
Dmitry Stogov
3bc4a63fc2 Fixed bug #76800 (foreach inconsistent if array modified during loop) 2018-09-14 10:28:31 +03:00
Dmitry Stogov
437e91e194 Keep collision list ordered from higher to lower buckets. 2018-09-04 01:19:07 +03:00
Dmitry Stogov
cd9f0a22fc Perform run-time binding reusing HashTable bucket (without new bucket insertion). 2018-08-29 00:35:07 +03:00
Dmitry Stogov
5674cf888d Use better macros 2018-07-30 16:48:34 +03:00
Dmitry Stogov
909f943fe5 Loop optimization 2018-07-30 16:08:45 +03:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
ebd1f5af3e API cleanup.
Removed useless filename and lineno arguments, used in DEBUG build.
The patch doesn't break source compatibility of public API (only binary compatibility).
2018-07-23 15:24:07 +03:00
Dmitry Stogov
3b6e1ee4ee Improved "Fast Shutdown". 2018-07-17 17:31:04 +03:00
Dmitry Stogov
0b90cf85a6 Removed "dead" code (zend_hash_update() never fails) 2018-06-01 11:58:57 +03:00
Dmitry Stogov
0d72bb8fcb Optimize zend_new_array() for special case, when size <= HT_MIN_SIZE 2018-05-31 01:17:55 +03:00
Dmitry Stogov
37069d7d2f Replace unused generic zend_hash_*add_or_update() functions by compact implmentations. 2018-05-29 01:38:27 +03:00
Dmitry Stogov
f4b7239cae _zend_hash_index_add_or_update_i() optimization 2018-05-29 00:09:49 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Xinchen Hui
a48ade17db Cleanup 2018-05-08 17:32:35 +08:00
Dmitry Stogov
a0e4488ec7 Optimize zend_hash_find() for the most usual case 2018-05-07 15:18:02 +03:00
Dmitry Stogov
34ed8e53fe Changed worst HashTable load factor from 1.0 to 0.5 2018-05-04 02:41:35 +03:00
Dmitry Stogov
dc091870ea Prefer reloading key->h 2018-04-02 23:43:37 +03:00
Dmitry Stogov
a795bd8265 Optimize zend_hash_real_init() 2018-03-23 00:13:45 +03:00
Dmitry Stogov
8598240c69 Fixed a behavior break introduced by d7f2dc4ec6 2018-03-22 16:37:34 +03:00
Dmitry Stogov
d7f2dc4ec6 Improve HashTable iterators handling:
- Avoid iterators check/update on each HashTable update opration
- Keep position equal (or above) nNumUsed instead of HT_INVALID_IDX
- Fixed iterators handling in array_unshift()
2018-03-22 02:41:49 +03:00
Dmitry Stogov
feb22b24cf Micro optimization 2018-03-21 12:39:56 +03:00
Dmitry Stogov
28ab2060ee Micro optimization 2018-03-21 11:57:54 +03:00
Dmitry Stogov
47f5f87826 Merge branch 'PHP-7.2'
* PHP-7.2:
  Don't keep HashTable.pDestructor in SHM and always set it into ZVAL_PTR_DTOR in zval_array_dup(). Keeping pointer to a function in SHM is not safe because of ASLR.
2018-03-06 01:02:31 +03:00
Dmitry Stogov
b48d2f6d10 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Don't keep HashTable.pDestructor in SHM and always set it into ZVAL_PTR_DTOR in zval_array_dup(). Keeping pointer to a function in SHM is not safe because of ASLR.
2018-03-06 01:00:14 +03:00
Dmitry Stogov
b711a96acb Don't keep HashTable.pDestructor in SHM and always set it into ZVAL_PTR_DTOR in zval_array_dup().
Keeping pointer to a function in SHM is not safe because of ASLR.
2018-03-06 00:56:16 +03:00
Dmitry Stogov
baa9890112 Completely hide GC implementation details into zend_gc.c 2018-02-27 21:08:26 +03:00
Dmitry Stogov
9794272f3e Micro optimization 2018-02-13 00:56:48 +03:00
Dmitry Stogov
6fb5568b2d Merge HashTable.u.v.consistency into HashTable.u.v.flags 2018-01-22 15:32:34 +03:00
Dmitry Stogov
6634d5e313 Use HT_FLAGS() macro 2018-01-22 14:58:16 +03:00
Dmitry Stogov
ebf900a9eb Introduce mcros to access HashTable iterators counter 2018-01-22 14:14:35 +03:00
Dmitry Stogov
9cbb521094 Access HashTable.u.flags through HT_FLAGS() macro. 2018-01-22 13:36:15 +03: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
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Li-Wen Hsu
72ec23d823 Fix bug #75677: Drop fastcall attribute on variadic function
Fastcall generally doesn't make sense on variadic functions. For
clang in particular this eliminates a "fastcall calling convention
ignored on variadic function" warning.
2017-12-15 21:56:08 +01:00
Dmitry Stogov
74c84cd7f0 Use zend_string_equal*() API for zend_string equality check instead of direct memcmp() usage. 2017-12-04 17:17:02 +03:00
Dmitry Stogov
ec2dde0c0b Introduced zend_hash_find_ex() that may avoid unnecessary hash value check. 2017-11-24 14:01:19 +03:00
Dmitry Stogov
ed7f396721 Avoid second hash value check 2017-11-24 12:03:59 +03:00
Dmitry Stogov
6de54703f0 Improved zend_hash_str_add/update functions 2017-10-31 10:35:28 +03:00
Dmitry Stogov
49ea143bbd Encapsulate reference-counting primitives.
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00