Commit Graph

127 Commits

Author SHA1 Message Date
Dmitry Stogov
2aefd11211 Optimize access to thread local cache.
This patch saves one CPU instruction on each "_tsrm_ls_cache" access in ZTS CLI/CGI/FPM builds.
This reduce typical instruction sequence for EG(current_execute_data) access from 4 to 3 CPU instructions.
2019-09-18 14:03:07 +03:00
Peter Kokot
f99adb4bb5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove TSRM/tsrm_config.w32.h
2019-07-10 21:20:10 +02:00
Peter Kokot
d63fdced2e Remove TSRM/tsrm_config.w32.h
The tsrm_config.w32.h file is a simple wrapper for already defined
symbols and includes elsewhere.

Closes GH-4383
2019-07-10 21:19:44 +02:00
Peter Kokot
b1ef50091d Remove some old BeOS artefacts
- checking for beos systems is no longer relevant in configure.ac
- usage of undefined constant BETHREADS removed.

Closes GH-4346
2019-07-02 22:08:54 +02:00
Joe Watkins
b98cd0719a
Merge branch 'PHP-7.4'
* PHP-7.4:
  implement tsrm_is_shutdown API
2019-06-28 10:27:39 +02:00
Joe Watkins
68485f8ab4
implement tsrm_is_shutdown API 2019-06-28 10:27:19 +02:00
Joe Watkins
5fd027e35c
Merge branch 'PHP-7.4'
* PHP-7.4:
  This reverts 0e5d4ea555 to fix the build on MacOSX
2019-06-11 15:15:31 +02:00
Joe Watkins
69190ce5c0
This reverts 0e5d4ea555 to fix the build on MacOSX
On Mac thread_local and __thread are not ABI compatible, in addition, thread_local
comes with additional overhead, __thread seems to be the most suitable linkage to use
regardless of c++/c
2019-06-11 15:13:27 +02:00
Nikita Popov
623eedbbd5 Merge branch 'PHP-7.4' 2019-06-04 16:14:46 +02:00
Nikita Popov
18060e5923 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-04 16:14:26 +02:00
Nikita Popov
a4633b13d4 Merge branch 'PHP-7.2' into PHP-7.3 2019-06-04 16:14:14 +02:00
Nikita Popov
2d3bc71e89 Reload tsrmls_id in release builds as well
If TSRM is shut down and started again (something that phpdbg does),
then tsrmls_id needs to be reloaded everywhere. As tsrmls_id
update is a rare operation, doing that shouldn't be a problem.
2019-06-04 16:12:59 +02:00
Peter Kokot
465c82b1af Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove TSRM configuration header
2019-04-29 22:35:24 +02:00
Peter Kokot
ce65d2354c Remove TSRM configuration header
TSRM configuration header file was once created by separate autoconf
build system for TSRM and is with the current code not directly needed
like this anymore.
2019-04-29 22:34:43 +02:00
Nikita Popov
f89f67037a Merge branch 'PHP-7.4' 2019-04-11 10:42:05 +02:00
Nikita Popov
b213f13a26 Make tsrm_env_lock() void
We're not checking the return value and the NTS version of this
generates warnings. If we want to handle lock failures, we should
do a hard abort inside tsrm_env_lock() itself.
2019-04-11 10:40:54 +02:00
Peter Kokot
e4a563b0c0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_SIGNAL_H
2019-04-07 15:57:21 +02:00
Peter Kokot
5f8915786f Remove HAVE_SIGNAL_H
The `<signal.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.

Since file requires at least C89 or greater, the `HAVE_SIGNAL_H` symbol
defined by Autoconf in Zend.m4 [2] can be ommitted and simplifed.

The bundled libmagic (file) also ommits the usage of HAVE_SIGNAL_H since
5.35 however current version in PHP is very modified 5.34 version and
will be refactored separately. Check for HAVE_SIGNAL_H is therefore
still done in the configure.ac.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2019-04-07 15:55:34 +02:00
Dmitry Stogov
9a06876072 Added JIT compiler for x86 and x86_64 2019-04-01 10:27:11 +03:00
Joe Watkins
abd0e015a8
Merge branch 'PHP-7.4'
* PHP-7.4:
  tsrm environment lock
2019-03-29 19:06:59 +01:00
Joe Watkins
072eb6dd77
tsrm environment lock 2019-03-29 19:06:02 +01:00
Joe Watkins
bd73607b9e
TSRM cleanup for PHP8 2019-03-25 08:00:17 +01:00
Dmitry Stogov
9499484ed2 Implemented a faster way to access predefined TSRM resources - CG(), EG(), etc. 2019-03-14 03:01:01 +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
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Zeev Suraski
67e0138c0d Future-proof email addresses... 2018-11-01 18:30:28 +02:00
Xinchen Hui
d6b2756da1 Merge branch 'PHP-7.2'
* PHP-7.2:
  Updated NEWS
  Fixed bug #75735 ([embed SAPI] Segmentation fault in sapi_register_post_entry)
2017-12-27 12:52:44 +08:00
Xinchen Hui
6693898b30 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75735 ([embed SAPI] Segmentation fault in sapi_register_post_entry)
2017-12-27 12:52:06 +08:00
Xinchen Hui
dc3822c343 Fixed bug #75735 ([embed SAPI] Segmentation fault in sapi_register_post_entry) 2017-12-27 12:51:50 +08:00
Anatol Belski
e8db69f3f7 Add info about thread API used 2017-12-21 17:54:31 +01:00
Anatol Belski
c6d0c8aa3b Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix C++ compatibility for TSRM_TLS
2017-11-15 12:45:21 +01:00
Anatol Belski
0e5d4ea555 Fix C++ compatibility for TSRM_TLS
If a C++11 source is compiled, thread_local is preferred. Furthermore,
at least GCC treats __thread vs. thread_local a different way and under
certain circumstances would refuse to compile __thread is a C++11 source.
This change is far behind in time, any up-to-date compiler supports C++11
and otherwise it won't take effect on lower versions.
2017-11-15 12:44:04 +01:00
Kalle Sommer Nielsen
d3bc8beb4f Removed support for BeOS, development for BeOS was supported 17 years ago.
This patch however does not drop support for the BeOS compatible variant, Haiku, see Github PR #2697 which is currently a WiP

I intentionally left out some fragments for BeOS in the build system for that seems to be bundles
2017-08-29 22:03:56 +02:00
Kalle Sommer Nielsen
bfdd22a3de Remove old references to SAPIs and extensions no longer in the core 2017-07-19 09:09:24 +02:00
Anatol Belski
6a3a2bf18e vim folds and mode lines yet 2017-07-04 17:06:52 +02:00
Anatol Belski
4d64a49fcd export the main thread info 2017-04-15 17:48:40 +02:00
Anatol Belski
c698299550 Interned strings unification for TS/NTS
Hereby, interned strings are supported in thread safe PHP. The patch
implements two types of interned strings

- interning per process, strings are not freed till process end
- interning per request, strings are freed at request end

There is no runtime interning.

With Opcache, all the permanent iterned strings are copied into SHM on
startup, additional copying into SHM might happen on demand.
2017-03-04 10:39:13 +01:00
Nikita Popov
1ac152938c Move semicolon into TSRMLS_CACHE_EXTERN/DEFINE
Also re bug #71575.
2016-03-03 16:50:01 +01:00
Anatol Belski
94e272f1b3 TSRM_TLS should be usable in NTS build 2015-08-17 23:12:49 +02:00
Anatol Belski
ffa341de59 add macro to access globals as whole 2015-07-30 09:05:08 +02:00
Anatol Belski
d428bf2d4e improve debugability in TS debug builds
gdb seems to be not always able to fetch the correct context for
thread locals. Thus, the "if (TSRMLS_CACHE)" clause causes gdb to
show crashes which aren't recognized neither with helgrind nor
in release builds. This is reproducable by setting breakpoints on
the exact line where PHP has a tsrm_get_ls_cache() call.
2015-02-17 19:15:22 +01:00
Anatol Belski
af3ca74501 made ZEND_TSRMLS_CACHE_* macros look like function calls
which also comply with the current semantics for such macros
2015-02-16 17:19:32 +01:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
2bc63e7b6d missed include for intptr_t/uintptr_t 2014-12-22 11:28:13 +01:00
Anatol Belski
d59fc5951e use cleaner tsrm_intptr_t/tsrm_uintptr_t typedef 2014-12-22 11:08:52 +01:00
Ferenc Kovacs
a9e86957c7 fix zts build on mac/clang 2014-12-21 20:01:39 +01:00
Anatol Belski
24f0d2ed54 make the TSRM macros depend no the macroed cache name 2014-12-16 10:44:43 +01:00
Anatol Belski
64b423d6ed removed the extra tsrm pointer passed to ctor/dtor 2014-12-16 08:03:15 +01:00
Anatol Belski
de99a94c38 explicit passing of *tsrm_ls isn't needed anymore 2014-12-12 08:11:14 +01:00
Anatol Belski
22be00cb3c TSRMLS_D should be void, thanks Dmitry 2014-12-11 10:03:39 +01:00