Commit Graph

77 Commits

Author SHA1 Message Date
Dmitry Stogov
415000ed93 Fixed bug #70573 (Cloning SplPriorityQueue leads to memory leaks) 2015-09-24 16:42:59 +03:00
Dmitry Stogov
53403fe56d Get rid of ZVAL_ZVAL() macro usages. Replace them with more clear and optimal equialent sequences. 2015-07-01 02:05:21 +03:00
Rasmus Lerdorf
28d7bb97a1 Fix more proto comments 2015-06-23 17:46:20 -04:00
Bob Weinand
e58a1abb00 Fix memory leak (double copy) in SplPriorityQueue 2015-06-19 03:42:59 +02:00
Nikita Popov
fb346c8f93 Support references in convert_to_*
conver_to_* functions now accept REFERENCE values, which will be
unwrapped before performing the usual conversion. This is consistent
with convert_scalar_to_number and matches the expected behavior in
a couple random use-sites I checked.

Also includes a couple fixes/cleanups elsewhere and two tests for
cases that previously didn't work (though the reference issue existed
all over the place).
2015-06-16 19:55:33 +02:00
Stanislav Malyshev
75d16a4564 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #69737 - Segfault when SplMinHeap::compare produces fatal error

Conflicts:
	ext/spl/spl_heap.c
2015-06-01 22:55:16 -07:00
Stanislav Malyshev
e96c64ed5e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #69737 - Segfault when SplMinHeap::compare produces fatal error
2015-06-01 22:53:56 -07:00
Stanislav Malyshev
1cbd25ca15 Fix bug #69737 - Segfault when SplMinHeap::compare produces fatal error 2015-06-01 22:07:16 -07:00
Nikita Popov
86152b18a3 Add GC support to SPL heap and PQ
ctor/dtor are now no longer called for insert/delete_top operations,
only for cloning and freeing of the object. Otherwise elements will
have a minimum rc of 2 and GC won't be able to free them.
2015-04-15 22:00:12 +02:00
Nikita Popov
dc764bf644 Use object apply count in var_dump / print_r
Instead of using the array apply count on the debug_info array, use
the object apply count for recursion detection when dumping. This
handles recursion in a more generic way and does not require each
debug_info handler to deal with this.

This allows returning a temporary debug_info array, instead of
having to store it in the object (thus delaying destruction of the
values).

Switch SPL debug_info handlers to use a temporary array.
2015-04-15 22:00:12 +02:00
Nikita Popov
e10be0d0fd Remove unnecessary retval members in SPL
This is what the rv params are for. Avoid holding onto values
longer than necessary.
2015-04-15 20:39:08 +02:00
Dmitry Stogov
9e70d7672d Move zend_object->guards into additional slot of zend_object->properties_table[]. As result size of objects without __get/__set/__unset/__isset magic methods is reduced. 2015-02-04 15:24:13 +03:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
da1d0ee1bd fix the comparison return value 2014-10-29 15:30:10 +01:00
Anatol Belski
3a6db1e77a fix datatype mismatch 2014-10-29 15:30:09 +01:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Julien Pauli
0686b4448d implement #67886 2014-08-26 10:02:55 +02:00
Anatol Belski
af59e92b24 master renames phase 7 2014-08-25 21:51:49 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
4498f93c0e more fixes to ext/spl 2014-08-20 18:06:01 +02:00
Anatol Belski
90d6f60bc1 mostly fixes to spl, but also some other 2014-08-17 13:31:39 +02:00
Anatol Belski
cb25136f4e fix macros in the 5 basic extensions 2014-08-16 11:37:14 +02:00
Dmitry Stogov
c1965f58d4 Use reference counting instead of zval duplication 2014-06-05 16:04:11 +04:00
Xinchen Hui
d8651fbe1c Make they are in the same style of Z_ISREF 2014-05-03 16:08:58 +08:00
Dmitry Stogov
72c287bd23 Combine HashTable.flags and HashTable.nApplyCount into single 32-bit word 2014-04-21 18:25:34 +04:00
Nikita Popov
20f2e5986e Fix ZTS build
This only makes it compile, it doesn't actually work, presumably
because interned strings are assumed in some places.
2014-04-09 23:41:16 +02:00
Dmitry Stogov
7402af380b Fixed destruction of objects and iterators on unclean request shutdown and GC (few cases are still unfixed).
Now we destroy objects it two steps. At first - object properties of all objects and only then the objects their selves.
2014-04-09 01:50:15 +04:00
Dmitry Stogov
b7938ab1bd Refactored GC (incomplete) 2014-03-19 17:00:28 +04:00
Xinchen Hui
6dd3d5cb36 Should not release container before dup 2014-03-15 22:43:40 +08:00
Xinchen Hui
8558dc8eaf Refactor Spl_Heap to fixed bug after default_properties change 2014-03-15 19:14:11 +08:00
Xinchen Hui
171fde5491 Fixed SplPriorityQueue's free_obj 2014-03-01 12:44:33 +08:00
Xinchen Hui
0680cdb4ac Fixed refcount handling 2014-02-28 22:47:24 +08:00
Xinchen Hui
a5ce7d526e Revert "Move zend_objects_store_put out of zend_object_std_init"
This reverts commit 8ced4f0ac9.
2014-02-28 13:59:07 +08:00
Xinchen Hui
8ced4f0ac9 Move zend_objects_store_put out of zend_object_std_init 2014-02-28 12:59:51 +08:00
Xinchen Hui
0817cee164 Fixed object creating (std_init calls store_put now) 2014-02-27 22:47:30 +08:00
Xinchen Hui
382b0dfdb7 Refactoring zend_iterator (incompleted) 2014-02-27 19:19:02 +08:00
Dmitry Stogov
495551aa8c Fixed iterators API. zend_iterator_init() has to be used in each get_iterator() callback. 2014-02-26 15:01:08 +04:00
Xinchen Hui
c1c4d26817 Use better data structures (incomplete) 2014-02-19 17:58:39 +08:00
Dmitry Stogov
2b9b9afa7a Use better data structures (incomplete) 2014-02-17 17:59:18 +04:00
Xinchen Hui
f0168baecf Use better data structures (incomplete) 2014-02-16 22:15:54 +08:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Levi Morrison
7f3b5b77cc Standardized usage of zpp_none and the order of the comparison zpp(...) == FAILURE 2013-10-11 10:32:40 -06: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
Xinchen Hui
a10da87c6a Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in different keys)
2012-05-24 23:34:14 +08:00