Commit Graph

206 Commits

Author SHA1 Message Date
Dmitry Stogov
4111daf2b4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Better data packing
2019-03-12 22:19:36 +03:00
Dmitry Stogov
824a933398 Better data packing 2019-03-12 22:19:11 +03:00
Dmitry Stogov
24378d1809 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #77345 (Stack Overflow caused by circular reference in garbage collection)
  Add support for MemorySanitizer
2019-03-07 13:58:42 +03:00
Dmitry Stogov
2f2d15791a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #77345 (Stack Overflow caused by circular reference in garbage collection)
2019-03-07 13:53:43 +03:00
Dmitry Stogov
5da591c529 Fixed bug #77345 (Stack Overflow caused by circular reference in garbage collection) 2019-03-07 13:33:19 +03:00
Peter Kokot
18295b396f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix typos in code comments in Zend/ [skip ci]
2019-02-18 17:56:38 +01:00
Tyson Andre
da3316ff0f Fix typos in code comments in Zend/ [skip ci] 2019-02-18 17:56:28 +01:00
Dmitry Stogov
91ef4124e5 Refactor zend_object_handlers API to pass zend_object* and zend_string* insted of zval(s). 2019-02-04 13:20:25 +03:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
a81202ac49 Adios, yearly copyright ranges 2019-01-30 11:48:28 +01: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
Nikita Popov
1cfbb21790 Classify object handlers are required/optional 2018-10-16 20:53:59 +02: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
Xinchen Hui
9d1e9b73c5 rename ref_dtor_func to rc_dtor_func 2018-07-06 19:15:26 +08:00
Xinchen Hui
f9297387f4 Rename zval_dtor_func and ref_dotr_func 2018-07-06 18:47:30 +08:00
Xinchen Hui
e3355ac5ec Revert "Rename _zval_dtor_func to _ref_dtor_func"
This reverts commit a362ae6b12.
2018-07-06 18:37:45 +08:00
Xinchen Hui
a362ae6b12 Rename _zval_dtor_func to _ref_dtor_func 2018-07-06 18:32:27 +08:00
Xinchen Hui
9465ec4673 Added num_roots to gc_status 2018-06-13 16:41:51 +08:00
Dmitry Stogov
e788e8261e Removed "gc_" prefix. 2018-06-13 11:28:24 +03:00
Dmitry Stogov
2afc83732c Allow access to some garbage collection internals (Benjamin Eberlei) 2018-06-13 11:10:17 +03:00
Xinchen Hui
ffaee27478 Fixed bug #76427 (Segfault in zend_objects_store_put) 2018-06-11 21:00:38 +08:00
Xinchen Hui
6c3a38353c indent 2018-05-22 17:05:39 +08:00
Xinchen Hui
bc1211b8b8 unnecessary branch 2018-05-22 17:04:42 +08:00
Nikita Popov
3b5b64ce75 Fix garbage marking in gc_collect_roots()
gc_collect_white() will mark white nodes as black and add them as
garbage, but only if it's not buffered yet. The already buffered
roots are instead marked as garbage in gc_collect_roots() directly.
However, if gc_collect_white() marked a (buffered) root as black
through recursion, it would not subsequently be marked as garbage.
2018-03-07 09:50:25 +01:00
Dmitry Stogov
c060d88c36 Fixed bug #76050 2018-03-06 03:31:06 +03:00
Dmitry Stogov
877da311bc Typo 2018-03-05 20:45:26 +03:00
Dmitry Stogov
ab139b6bfd Reverted e6d6fcedf7 and overdesign introduced in ae64dd6d56.
Now we have just indexex, pointers and linked list od unused buffers.
2018-03-05 20:20:58 +03:00
Nikita Popov
a0563aa7bc Fix incorrect GC_NUM2ADDR usage
Both first_unused and GC_MAX_UNCOMPRESSED are addresses, so we
should compare them directly.
2018-03-05 16:29:46 +01:00
Dmitry Stogov
e6d6fcedf7 Switch to better GC address representation 2018-03-02 17:36:18 +03:00
Dmitry Stogov
ae64dd6d56 Make distinct between indexes/numbers, GC addresses and pointers to gc_root_buffers.
Perform conversion through macros.
2018-03-02 17:02:29 +03:00
Dmitry Stogov
f844d40fdc GC API cleanup 2018-03-02 11:02:21 +03:00
Dmitry Stogov
06c6c632c3 Switch to siple "commpression" scheme 2018-03-02 10:01:08 +03:00
Dmitry Stogov
8b5e76c790 micro-optimization 2018-03-02 01:53:59 +03:00
Dmitry Stogov
5c78bb80cc Cleanup 2018-03-02 01:42:42 +03:00
Dmitry Stogov
26e0ebffac Tunning for fast paths 2018-03-01 17:38:32 +03:00
Dmitry Stogov
165dadace3 Cleanup 2018-03-01 15:51:50 +03:00
Dmitry Stogov
5994b8ac95 Improve GC color checks 2018-03-01 11:55:26 +03:00
Dmitry Stogov
077d227500 Implemented simple adaptive GC threshold selection. 2018-03-01 11:04:28 +03:00
Dmitry Stogov
fd348ec43f GC improvement 2018-03-01 03:17:21 +03:00
Dmitry Stogov
4631a5e2e1 Tunning for new GC_TYPE_INFO layout 2018-02-28 13:25:29 +03:00
Dmitry Stogov
31e5c34542 typo 2018-02-28 10:16:51 +03:00
Dmitry Stogov
6f483dc94c Use macros to update specific parts of GC_TYPE_INFO() (direct assignments to GC_TYPE(), GC_FLAGS() and GC_INFO() are prohibited) 2018-02-28 00:52:12 +03:00
Dmitry Stogov
baa9890112 Completely hide GC implementation details into zend_gc.c 2018-02-27 21:08:26 +03:00
Dmitry Stogov
b3e22da745 Use OBJ_FLAGS() macro to access object flags (even if they are currently stored together with GC_FLAGS) 2018-01-22 15:57:00 +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
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
Anatol Belski
bc5811f361 further sync for vim mode lines 2017-07-04 18:12:45 +02:00
Dmitry Stogov
c0be77aa75 Removed deprecated checks. 2017-06-27 13:12:09 +03:00
Nikita Popov
361b7159e7 Merge branch 'PHP-7.1' 2017-03-07 13:18:04 +01:00
Nikita Popov
8a6281455e Merge branch 'PHP-7.0' into PHP-7.1 2017-03-07 13:17:33 +01:00
Nikita Popov
549a30d2cd Fix out of bounds access in gc_find_additional_buffer() 2017-03-07 13:16:06 +01:00
Xinchen Hui
00e5ea7b76 Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug  #73989 (PHP 7.1 Segfaults within Symfony test suite)

Conflicts:
	Zend/zend_gc.c
2017-02-13 19:24:00 +08:00
Xinchen Hui
9df7cc3e68 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug  #73989 (PHP 7.1 Segfaults within Symfony test suite)
2017-02-13 19:17:09 +08:00
Xinchen Hui
3917350531 Fixed bug #73989 (PHP 7.1 Segfaults within Symfony test suite) 2017-02-13 19:16:17 +08:00
Xinchen Hui
cad92c1243 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed typo
2017-02-11 00:02:07 +08:00
Xinchen Hui
808a11041d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed typo
2017-02-11 00:01:38 +08:00
Xinchen Hui
db7c0badd4 Fixed typo 2017-02-11 00:01:09 +08:00
Dmitry Stogov
a082824725 Replace redundand checks with ZEND_ASSERT. We shouldn't get IS_OBJECTs without object_storage. 2017-02-03 18:31:25 +03:00
Nikita Popov
fd4025069d
Enable HT RC assertions with escape-hatch
HT functions that modify the array now assert that rc=1. As we don't
respect this COW constraint everywhere, either for a good reason or
because fixing it would take more work, we provide an escape hatch
in the form of HT_ALLOW_COW_VIOLATION(ht). If this macro is called
assertions on this ht are disabled. The macro is a no-op in release
mode.
2017-01-23 17:19:06 +00:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Bob Weinand
dfb3e270c2 Merge remote-tracking branch 'origin/PHP-7.0' into PHP-7.1 2016-07-27 18:18:47 +02:00
Bob Weinand
5513f00a97 Fixed a potential segfault in zend_objects_store_free_object_storage()
Under the special circumstance where a garbage collected objects bucket slot was not reused until the end of the script, we get access into freed memory...
No test added as it usually is valgrind-only, and only sometimes when the memory happens to have changed (i.e. (GC_FLAGS(obj) & IS_OBJ_FREE_CALLED) == 0), it actually *may* segfault
2016-07-27 18:08:43 +02:00
Dmitry Stogov
8fc934b0a1 Fixed bug #71818 (Memory leak when array altered in destructor) 2016-07-14 12:05:44 +03:00
c9s
9288ce5390 Add document for zend_gc_collect_cycles 2016-07-11 12:44:42 +02:00
Dmitry Stogov
cca2c8ecc4 Reimplemented Bob's commit bac6fdb0c5 without insignificant renaming and white-space changes 2016-05-06 10:47:58 +03:00
Dmitry Stogov
c19cb70dac Revert "Refactor zval cleanup into single function"
This reverts commit bac6fdb0c5.
2016-05-06 10:47:58 +03:00
Bob Weinand
bac6fdb0c5 Refactor zval cleanup into single function
Also use zval_ptr_dtor_nogc() everywhere in Zend in favor of zval_dtor()
2016-05-05 23:31:57 +02:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Xinchen Hui
2f2653aa77 Fixed bug #70805 (Segmentation faults whilst running Drupal 8 test suite) 2015-11-03 17:53:56 -08:00
Dmitry Stogov
500b884f17 Fixed return without value 2015-05-06 22:53:48 +03:00
Dmitry Stogov
2a9f9860d7 Fixed bug #69534 (Cycle leaks through declared properties on internal classes) 2015-05-06 21:33:49 +03:00
Dmitry Stogov
6718b56e45 Change the GC approach to inner-loops handling. Switch to less efficient but more robust algorithm. Destructors handling is still not completely accurate. 2015-04-17 18:35:57 +03:00
Dmitry Stogov
276080ec3a Added GC checks and improvements 2015-04-17 03:55:37 +03:00
Dmitry Stogov
00445ba22d Fixed bug #69446 (GC leak relating to removal of nested data after dtors run) 2015-04-14 19:53:56 +03:00
Dmitry Stogov
26a6d707a1 Fixed memory leak in ext/standard/tests/array/compact_variation1.phpt 2015-04-14 13:45:05 +03:00
Dmitry Stogov
9806a62545 GC improved to support inner-cycles. 2015-04-14 00:16:27 +03:00
Dmitry Stogov
b8fa90f10f GC tweaks 2015-04-13 18:53:02 +03:00
Nikita Popov
71ccbf77a0 Add support for more debug output during CC
Compile with ZEND_DEBUG_GC=2
2015-04-11 18:29:36 +02:00
Xinchen Hui
f08414ce1d Temporary fix inifite loop in gc 2015-04-11 17:40:29 +08:00
Dmitry Stogov
8eaa09887c Added GC debug code and some small optimizations. 2015-04-10 22:06:01 +03:00
Dmitry Stogov
7c2956d15c Merge branch 'PHP-5.6'
* PHP-5.6:
  Prevent GC from changing zval or object 'color' before they are actually inserted into possible roots buffer.

Conflicts:
	NEWS
	Zend/zend_gc.c
2015-04-02 12:37:34 +03:00
Dmitry Stogov
f29c98c128 Prevent GC from changing zval or object 'color' before they are actually inserted into possible roots buffer. 2015-04-02 12:29:15 +03:00
Dmitry Stogov
db10b72523 Use fastcall calling convention for most critical ZE subsystems. 2015-03-13 21:10:09 +03:00
Dmitry Stogov
e10e151e9b Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
2015-02-13 22:20:39 +03:00
Dmitry Stogov
a787719d4f Removed TSRMLS_D 2015-02-04 18:47:30 +03:00
Adam Harvey
eb6dc9db29 Make gc_collect_cycles hookable. 2015-01-23 19:23:58 +00:00
Dmitry Stogov
46e486ff3d It doesn't make sense to colect garbage after fatal errors 2015-01-23 16:40:16 +03:00
Dmitry Stogov
f71e64e53a Revert "Fixed ASSERTION"
This reverts commit 76f438e06f.
2015-01-23 16:37:39 +03:00
Xinchen Hui
76f438e06f Fixed ASSERTION 2015-01-23 14:18:56 +08:00
Dmitry Stogov
6f0e5aab43 Fixed GC after destruction of object store. 2015-01-22 20:38:42 +03:00
Dmitry Stogov
e21fefde38 Fixed destruction of circular garbage 2015-01-22 14:24:27 +03:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +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
Dmitry Stogov
109baa0394 Fixed compilation warnings 2014-11-27 12:52:31 +03:00