summaryrefslogtreecommitdiff
path: root/Zend/zend_objects_API.c
Commit message (Collapse)AuthorAgeFilesLines
* Destroy constant values before object storeNikita Popov2021-03-181-4/+1
| | | | | | | | Now that constants can contain objects (currently only enums), we should destroy them before we free the object store, otherwise there will be false positive leak reports. This doesn't affect the fast_shutdown sequence.
* Implement enumsIlija Tovilo2021-03-171-1/+4
| | | | | | | | RFC: https://wiki.php.net/rfc/enumerations Co-authored-by: Nikita Popov <nikita.ppv@gmail.com> Closes GH-6489.
* Replace zend_bool uses with boolNikita Popov2021-01-151-1/+1
| | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* Remove delref in free_object_storageNikita Popov2019-08-281-3/+2
| | | | This gives us better object leak diagnostics.
* Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-03-181-2/+3
|\
| * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-03-181-2/+3
| |\
| | * Don't disable object slot reuse while running shutdown functionstwosee2019-03-181-2/+3
| | | | | | | | | | | | | | | | | | We only need to do this once we're running destructors. The current approach interferes with some event loop code that runs everything inside a shutdown function.
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-03-011-2/+7
|\ \ \ | |/ /
| * | Check for NULL GC type in objects_store_delNikita Popov2019-03-011-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This might happen if OBJ_RELEASE is used on an object that was already released by GC. Specific cases of this issue were previously fixed in ffaee27478a9cb338e40edeb5acf233f9cb67111 and 72104d2b6ecbbabd18de15f10739be5ce3dc9ce0, however the issue still affects 3rd-party extensions using OBJ_RELEASE. The whole GC type NULL + OBJ_IS_VALID + IS_FREE_CALLED system seems overly complicated and can probably be simplified in 7.4.
| * | Future-proof email addressesZeev Suraski2018-11-011-3/+3
| | |
* | | Remove local variablesPeter Kokot2019-02-031-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Adios, yearly copyright rangesZeev Suraski2019-01-301-1/+1
| | |
* | | micro-optimizationDmitry Stogov2018-11-151-5/+4
| | |
* | | Split zend_objects_store_put() into hot/cold partsDmitry Stogov2018-11-151-6/+15
| | |
* | | Reorder conditions and set expectation.Dmitry Stogov2018-11-061-2/+2
| | |
* | | Update email addresses. We're still @Zend, but future proofing it...Zeev Suraski2018-11-011-3/+3
| | |
* | | Classify object handlers are required/optionalNikita Popov2018-10-161-17/+11
|/ /
* | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2018-09-281-2/+4
|\ \ | |/
| * Merge branch 'PHP-7.1' into PHP-7.2Nikita Popov2018-09-281-2/+4
| |\
| | * Fixed bug #76846Nikita Popov2018-09-281-2/+4
| | |
| | * year++Xinchen Hui2018-01-021-1/+1
| | |
| | * Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
| * | year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Remove unused Git attributes identPeter Kokot2018-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Fixed bug #76427 (Segfault in zend_objects_store_put)Xinchen Hui2018-06-111-4/+0
| | |
* | | Export standard object handlers, to avoid indirect accessDmitry Stogov2018-05-311-5/+0
| | |
* | | Keep initialized object_handlers structures in read-only memory.Dmitry Stogov2018-03-141-1/+1
| | |
* | | Use macros to update specific parts of GC_TYPE_INFO() (direct assignments to ↵Dmitry Stogov2018-02-281-6/+6
| | | | | | | | | | | | GC_TYPE(), GC_FLAGS() and GC_INFO() are prohibited)
* | | Use OBJ_FLAGS() macro to access object flags (even if they are currently ↵Dmitry Stogov2018-01-221-11/+11
| | | | | | | | | | | | stored together with GC_FLAGS)
* | | Replace checks with assertsDmitry Stogov2018-01-161-33/+30
| | |
* | | year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Use fastcall calling convention for objects and resources APIDmitry Stogov2017-12-141-8/+8
| | |
* | | Encapsulate reference-counting primitives.Dmitry Stogov2017-10-271-11/+11
|/ / | | | | | | | | | | 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.
* | further sync for vim mode linesAnatol Belski2017-07-041-0/+2
| |
* | Cleanup. Removed unused functions and unimplemented prototype. Avoid useless ↵Dmitry Stogov2017-06-271-27/+11
| | | | | | | | "dtor_obj" calls.
* | shutdown_executor() refactoring (reuse opcache fast request shutdown code)Dmitry Stogov2017-06-221-13/+30
| |
* | Don't use zend_try around dtor_obj() and free_obj()Nikita Popov2017-05-041-18/+4
| | | | | | | | | | | | | | | | | | Without these zend_trys we may a) leak the object (fine) b) don't add it to the free list (also fine, we just lose an object store bucket) c) don't remove it from the GC root buffer (also fine, because GC explicitly checks for both FREE_CALLED and invalid buckets)
* | Added EG(flags) - executor global flagsJim Zubov2017-02-091-5/+4
| | | | | | | | EG_FLAGS_IN_SHUTDOWN - is set when PHP is in shutdown state
* | newly added zend_object_store.no_reuse is redefined as a global ↵Jim Zubov2017-02-071-3/+5
| | | | | | | | | | | | zend_object_store_no_reuse, to avoid alignment issues
* | Bug Fix:Jim Zubov2017-02-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Corrupted class entries on shutdown when a destructor spawns another object (C) 2017 CommerceByte Consulting When zend_objects_store_call_destructors() is called from the shutdown sequence - it's calling the dtor's for remaining objects one by one in sequence of object handles. If the dtor spawns one or more objects, and the new objects happen to reuse the old handles - their dtor's are not called in this cycle. The dtor's are called later on, when zend_deactivete() kicks in, and the static property lists in the class entries are freed. This causes "Undefined static property" errors, and/or SIGSEGV. Solution: zend_object_store.no_reuse field is added Set to 0 on initialization, set to 1 on the shutdown sequence. zend_objects_store_put(zend_object *) checks the no_reuse flag, and never reuses the old handle slots if set. This way, the dtor's for newly spawned objects are guaranteed to be called in the zend_objects_store_call_destructors() loop.
* | Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
| |
* | Turn function into inlineDmitry Stogov2016-11-211-6/+0
|/
* Fixed Bug #71859 (zend_objects_store_call_destructors operates on realloced ↵Xinchen Hui2016-03-201-8/+4
| | | | memory, crashing)
* bump year which is missed in rev 49493a2Xinchen Hui2016-01-021-1/+1
|
* Add myself into list of authors of the most refactored files.Dmitry Stogov2015-08-311-0/+1
|
* Always report object leaksNikita Popov2015-07-031-16/+1
| | | | | | Previously cycles were excluded from leak reports, however the situation here has improved a lot in the meantime and we can report all leaks.
* Micro optimizationsDmitry Stogov2015-04-281-26/+39
|
* Partially enable leak reports for objectsNikita Popov2015-04-181-3/+5
| | | | | | | | | | Cycle leaks are currently not reported, because this needs further work. The last GC run has been moved to run earlier (before the object store free), so that array cycles that hold references to objects don't show up as leaks. Fingers crossed that this doesn't adversely affect anything else.
* bump yearXinchen Hui2015-01-151-1/+1
|
* trailing whitespace removalStanislav Malyshev2015-01-101-3/+3
|