Commit Graph

508 Commits

Author SHA1 Message Date
Anatol Belski
fca341699e don't pass zero to malloc() 2015-03-10 09:10:23 +01: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
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08: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
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +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
Anatol Belski
0180912823 default tsrmls cache to NULL 2014-11-19 12:26:24 +01:00
Anatol Belski
c6bad96f30 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (398 commits)
  NEWS
  add test for bug #68381
  Fixed bug #68381 Set FPM log level earlier during init
  proper dllexport
  move to size_t where zend_string is used internally
  fix some datatype mismatches
  return after the warning, to fix uninitialized salt usage
  fix datatype mismatches
  add missing type specifier
  fix datatype mismatches
  fix unsigned check
  "extern" shouldn't be used for definitions
  joined identical conditional blocks
  simplify fpm tests
  SEND_VAR_NO_REF optimization
  Add test for bug #68442
  Add various tests for FPM - covering recent bugs (68420, 68421, 68423, 68428) - for UDS - for ping and status URI - for multi pool and multi mode
  Include small MIT FastCGI client library from https://github.com/adoy/PHP-FastCGI-Client
  Get rid of zend_free_op structure (use zval* instead). Get rid of useless TSRMLS arguments.
  Add new FPM test for IPv4/IPv6
  ...

Conflicts:
	win32/build/config.w32
2014-11-18 21:18:52 +01:00
Anatol Belski
e6ea376a91 avoid repeated strlen usage, remove unused vars 2014-11-13 19:57:34 +01:00
Anatol Belski
999d387bf8 move these functions to the appropriate place
and include the necessary header
2014-11-10 10:58:19 +01:00
Anatol Belski
20f8f533e1 fix datatype mismatch warns 2014-10-29 15:30:03 +01:00
Anatol Belski
8aeffdd74c moved most of the core to use static tsrm ls cache pointer
plus apache2handler, cli and cgi
2014-10-15 16:33:40 +02:00
Anatol Belski
1fc8220b65 TSRMLS_FETCH() is a spent force 2014-10-15 09:46:35 +02:00
Anatol Belski
a91d3580a7 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  properly export tsrm_strtok_r()
  Fixed list() behavior inconsistency (string handling is disabled for all cases, ArrayAccess objects handling is enabled for all cases, ZEND_FETCH_DIM_TMP_VAR opcode is renamed into ZEND_FETCH_LIST, ZEND_FETCH_ADD_LOCK flag is removed).
  Fix accidental edit in previous commit
  Fix arginfo
  DateTimeZone::getOffset() now accepts a DateTimeInterface
  DateTimeZone::getOffset() now accepts a DateTimeInterface
  Moved checks and error reporting related to static methods from DO_FCALL inti INTI_FCALL* opcodes that may really deal with static methods. (In some rare cases it may lead to different order of warning messages).
  Fixed a bug that causes crash when environment variable is access while parsing php.ini
  Fixed a bug that causes crash when environment variable is access while parsing php.ini
2014-10-05 19:26:17 +02:00
Anatol Belski
d58b70622a properly export tsrm_strtok_r()
for this particular case fixing phar shared build, but for the
general usage anyway
2014-10-05 13:20:27 +02:00
Anatol Belski
ee4ae7fbc3 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  remove the remains of dsp files handling
  fix EX usage
  remove misprint parentheses
  remove misprint parentheses
  Replaced EG(This) and EX(object) with EX(This). Internal functions now recieves zend_execute_data as the first argument.
  And this one...
  It should be in extern c
  Remove useless condition
  NEWS entry for previous commit
  NEWS entry for previous commit
  add IPv6 support to php-fpm
  Micro optimization for the most frequency case
  Add hash to EXTENSIONS file
  Remove extensions which are long gone
  we also have xz release tarballs since 5.5
  Fix ZTS build
  improved file size computation in stat()
  Fixed incorrect compilation
  5.5.19 now
2014-10-03 20:30:49 +02:00
Anatol Belski
55c6737b73 remove misprint parentheses 2014-10-03 19:23:32 +02:00
Anatol Belski
45e23645a4 linux compat for the static tsrm ls cache pointer 2014-10-02 08:45:53 +02:00
Anatol Belski
76081df168 using pointer to the tsrm ls cache instead of a function call
yet another approach
2014-10-01 22:04:21 +02:00
Anatol Belski
24f9c924d7 prepare some macros to use tsrm cache as pointer
instead of a function call
2014-09-30 19:16:23 +02:00
Anatol Belski
d624b0d5eb Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (26 commits)
  Micro optimization
  Drop unused INIT_STRING opcode
  Drop unused RAISE_ABSTRACT_ERROR opcode
  CT substitute unqualified true/false/null in namespaces
  Fix a couple compile warnings
  fix test filename
  one more test to illustrate transfer of an arbitrary data amount throug pipes
  fix tests on linux
  better test cleanup
  Use more readable inline functions
  increase the polling period to not to break existing behaviours
  updated NEWS
  Fixed bug #51800 proc_open on Windows hangs forever
  Fixed segfault
  Set an LDAP error code when failing ldap_bind due to null bytes
  Fix segmentation fault in debug_backtrace()
  Drop support for GMP 4.1
  Make gmp_setbit and gmp_clrbit return values consistent
  removed *.dsw and *.dsp files
  Opcache compatibility for coalesce operator
  ...
2014-10-01 01:33:46 +02:00
Anatol Belski
9f9b3585b9 revert the local speedup approach 2014-10-01 01:33:01 +02:00
Anatol Belski
4b3e198023 removed *.dsw and *.dsp files 2014-09-28 19:02:09 +02:00
krakjoe
7d4f7c04b3 approach local pointers in performance sensitive areas 2014-09-27 17:11:56 +01:00
Anatol Belski
d11734b4b0 reworked the patch, less new stuff but worky
TLS is already used in TSRM, the way exporting the tsrm cache through
a thread local variable is not portable. Additionally, the current
patch suffers from bugs which are hard to find, but prevent it to
be worky with apache. What is done here is mainly uses the idea
from the RFC patch, but

- __thread variable is removed
- offset math and declarations are removed
- extra macros and definitions are removed

What is done merely is

- use an inline function to access the tsrm cache. The function uses
  the portable tsrm_tls_get macro which is cheap
- all the TSRM_* macros are set to placebo. Thus this opens the way
  remove them later

Except that, the logic is old. TSRMLS_FETCH will have to be done once
per thread, then tsrm_get_ls_cache() can be used. Things seeming to be
worky are cli, cli server and apache. I also tried to enable bz2
shared and it has worked out of the box. The change is yet minimal
diffing to the current master bus is a worky start, IMHO. Though will
have to recheck the other previously done SAPIs - embed and cgi.

The offsets can be added to the tsrm_resource_type struct, then
it'll not be needed to declare them in the userspace. Even the
"done" member type can be changed to int16 or smaller, then adding
the offset as int16 will not change the struct size. As well on the
todo might be removing the hashed storage, thread_id != thread_id and
linked list logic in favour of the explicit TLS operations.
2014-09-25 18:48:27 +02:00
Anatol Belski
aa8c424e0f call ctor if it's not done yet 2014-09-24 02:11:05 +02:00
Anatol Belski
58a2b05d7b fix indent 2014-09-23 17:14:41 +02:00
Anatol Belski
bec9fd7917 define explicit export/impot spec 2014-09-23 01:22:58 +02:00
Anatol Belski
4db75dc853 basic windows fix 2014-09-22 20:58:45 +02:00
Anatol Belski
2720743636 vars with __declspec(thread) cannot use __declspec(dllexport) 2014-09-20 22:13:10 +02:00
krakjoe
b3aebda9ea native tls initial patch 2014-09-20 20:22:14 +01:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
d1131d4278 reverted some previous IS_ABSOLUTE_PATH related changes
It's fine with strlen usage now, only one call
2014-09-19 16:30:05 +02:00
Anatol Belski
f162b3f736 correct type for the thread id 2014-09-18 17:14:52 +02:00
Anatol Belski
90972355b3 avoid repeated strlen usage 2014-09-14 17:00:34 +02:00
Anatol Belski
34f536693c avoid usage of 'type' before the null pointer check 2014-08-29 11:21:07 +02:00
Anatol Belski
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Anatol Belski
60ed3f78bd Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixed macro
2014-02-24 10:13:11 +01:00
Anatol Belski
bca0e5edd5 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fixed macro
2014-02-24 10:12:50 +01:00
Anatol Belski
c6a4a7cad6 fixed macro 2014-02-24 10:12:18 +01:00
Anatol Belski
07f3bac6ca fix *.dsp files related to bug #50333 2014-01-28 13:09:29 +01:00
Anatol Belski
4e7c9ea896 Fixed bug #66009 Failed compilation of PHP extension with C++ std library using VS 2012
Visual Studio 2012 includes sanity checks for C++11 features, see
http://msdn.microsoft.com/en-us/library/vstudio/bb531344(v=vs.110).aspx
To fix the 'inline' keyword redefinition for C++ in debug mode, the
new macros ZEND_WIN32_KEEP_INLINE is introduced, ZEND_WIN32_FORCE_INLINE is
automatically appended in release mode.
2014-01-04 01:41:27 +01:00
Anatol Belski
ae1cc83f98 Fixed bug #66009 Failed compilation of PHP extension with C++ std library using VS 2012
Visual Studio 2012 includes sanity checks for C++11 features, see
http://msdn.microsoft.com/en-us/library/vstudio/bb531344(v=vs.110).aspx
To fix the 'inline' keyword redefinition for C++ in debug mode, the
new macros ZEND_WIN32_KEEP_INLINE is introduced, ZEND_WIN32_FORCE_INLINE is
automatically appended in release mode.
2014-01-04 01:41:01 +01:00