Commit Graph

201 Commits

Author SHA1 Message Date
Dmitry Stogov
b3b616cf7e Introduced immutable arrays. They don't need to be copyed and may be used directly from SHM. 2014-05-29 18:21:56 +04:00
Dmitry Stogov
40256e0f9c Use specialized functions instead of macros 2014-05-26 17:16:16 +04:00
Dmitry Stogov
b66728aabb Removed useless initializations 2014-05-26 11:42:58 +04:00
Dmitry Stogov
9eb89dddb1 Use optimized zend_array_dup() function. convert zend_hash_num_elements() and zend_hash_next_free_element() into macros. 2014-05-23 20:37:53 +04:00
Dmitry Stogov
21da8af578 Removed the old hack that was originally developed to support constants in array indeces, and isn't needed anymore after the Bob's patch. 2014-05-19 01:20:56 +04:00
Dmitry Stogov
d07c1941ec Use new hash iteration API and avoid old zend_hash_update_current_key() hack 2014-05-19 00:50:00 +04:00
Tjerk Meesters
e7b50a8ee9 Convert to unpacked before deleting elements
Return FAILURE immediately if a string index removal is attempted.

Moved condition higher up
2014-05-13 11:58:28 +08:00
Nikita Popov
b30c7fe263 Port JSON 2014-05-05 01:00:59 +02:00
Dmitry Stogov
b1ff152782 Reimplement strtr() 2014-04-24 19:14:29 +04:00
Nikita Popov
c98d373eb6 Fix strict array comparison
Fixes Symfony test failures
2014-04-23 20:34:45 +02:00
Dmitry Stogov
72c287bd23 Combine HashTable.flags and HashTable.nApplyCount into single 32-bit word 2014-04-21 18:25:34 +04:00
Dmitry Stogov
050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Dmitry Stogov
3d17219cd8 Refactored zend_hash_* iteration API zend_hash_fove_forward_ex(ht, pos) and family require second argument to be real pointer.
&(ht)->nInternalPointer should be passed instead of NULL.
zend_hash_update_current_key() may work only with internal pointer.
2014-04-07 23:14:17 +04:00
Dmitry Stogov
3167b49ce9 Allocate HashTable->arData and HashTable->arHash at once 2014-04-07 18:22:03 +04:00
Dmitry Stogov
3485b11499 "incremental" hash bucket initialization 2014-04-07 13:31:44 +04:00
Dmitry Stogov
76cc99fe60 Refactored ZVAL flags usage to simplify various checks (e.g. Z_REFCOUNTED(), candidate for GC, etc) 2014-04-03 15:26:23 +04:00
Dmitry Stogov
d8099d0468 Changed data layout to allow more efficient operations 2014-04-02 14:34:44 +04:00
Dmitry Stogov
60961bba3d Avoid useless memset() 2014-04-01 23:56:45 +04:00
Dmitry Stogov
042c937f69 Use STR_COPY() instead of STR_DUP() where possible 2014-04-01 17:10:15 +04:00
Dmitry Stogov
887189ca31 Refactored IS_INDIRECT usage for CV and object properties to support HashTable resizing 2014-03-26 18:07:31 +04:00
Dmitry Stogov
62c448ab8b Fixed serialize/unserialize problems 2014-03-17 17:23:27 +04:00
Dmitry Stogov
51494f252f Don't include trailing zero into hash caclculation 2014-03-14 15:35:57 +04:00
Dmitry Stogov
3e4c22b499 Fixed possible HashTable modification in its destructor 2014-03-06 16:53:13 +04:00
Dmitry Stogov
e0f6bae56b Passing symbol_table into user error handlers 2014-03-04 14:17:17 +04:00
Xinchen Hui
a52659bc25 zend_hash_del didn't check the PACKED flag 2014-02-19 19:27:42 +08:00
Dmitry Stogov
5de7115679 Use better data structures (incomplete; able to run bench.php) 2014-02-18 16:27:38 +04:00
Dmitry Stogov
be82a07776 Use better data structures (incomplete) 2014-02-12 18:08:11 +04:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Dmitry Stogov
6c2a806820 Avoid interned hash key duplication and hash key length recaclulation 2013-11-29 00:57:49 +04:00
Dmitry Stogov
5d25762646 Removed unused "pHashFunction" argument in _zend_hash_init() and family (must be 99% source compatible) 2013-11-28 18:40:46 +04:00
Dmitry Stogov
b63b81815f Some rare deprecated cases replaced by ZEND_ASSERT() (some extensions might need to be fixed) 2013-11-28 17:02:01 +04:00
Dmitry Stogov
aa427a10d4 Removed duplicated hash function implementation (100% source compatible) 2013-11-28 17:01:10 +04:00
Stanislav Malyshev
02457554a3 Merge branch 'PHP-5.5'
* PHP-5.5:
  backward compatibility
  HASH_KEY_NON_EXISTANT fix
2013-07-21 20:10:31 -07:00
Veres Lajos
4749457a49 HASH_KEY_NON_EXISTANT fix 2013-07-21 20:09:53 -07:00
Nikita Popov
42729c1baf Merge branch 'PHP-5.5' 2013-06-17 23:49:08 +02:00
Nikita Popov
86434be946 Fix bug #65051: count() off by one inside unset()
nNumOfElements was incremented after the pDestructor code, so any
code in the dtor would get a wrong number of elements.

Right now the bucket deletion code is replicated in four places,
it should probably be moved off into one function (or rather,
zend_hash_apply_deleter should be used everywhere). The codes are
subtly different though in that the HANDLE_UNBLOCK_INTERRUPTIONS()
happens in different places. In particular it seems odd that in
some cases interruptions stay blocked during the destructor call.
2013-06-17 23:44:13 +02:00
Nikita Popov
ae91084067 Remove unnecessary NULL checks from zend_hash
Our memory allocation functions (including the persistent ones)
are infallible, so no need to check for NULL.
2013-06-17 18:51:59 +02:00
Nikita Popov
1f34ccbe34 Fix bug #64555: foreach no longer copies keys if they are interned 2013-04-03 20:29:19 +02:00
Nikita Popov
fcc6611de9 Add support for non-scalar Iterator keys in foreach
RFC: https://wiki.php.net/rfc/foreach-non-scalar-keys
2013-03-12 17:27:31 +01:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Dmitry Stogov
dc18f8427c Fixed icorrect key length after updating constant index 2011-12-01 13:58:29 +00:00
Dmitry Stogov
e43ff1359e Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Pierre Joye
710d46f38e - WS 2011-09-06 06:34:36 +00:00
Pierrick Charron
7f203d4385 Fix typo 2011-08-08 11:30:56 +00:00
Rasmus Lerdorf
1ac9192d46 Fix missing va_end() found by Coverity 2011-08-05 22:18:42 +00:00
Dmitry Stogov
8ff0701e8d Fixed bug #50816 (Using class constants in array definition fails). 2011-08-01 11:21:23 +00:00
Felipe Pena
5ca0f69921 - Fix ZTS build 2011-06-02 22:54:14 +00:00
Ilia Alshanetsky
939875133a Zend Signal Handling (see RFC: https://wiki.php.net/rfc/zendsignals)
This needs to go into 5.4 as well, but will wait for Pierre to review win32 situation

# Patch by Lucas Nealan, Arnaud Le Blanc, Brian Shire & Ilia Alshanetsky
2011-06-02 21:16:50 +00:00