mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: bring back the correct php_version.h fix the empty_strings SAPI shutdown leak in TS build Use fastcall calling convention for heap functions fix leaking the empty_string in TS builds remove successive assignment
This commit is contained in:
commit
bd9f17846d
7 changed files with 39 additions and 28 deletions
|
@ -445,10 +445,7 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
|
|||
compiler_globals->script_encoding_list = NULL;
|
||||
|
||||
#ifdef ZTS
|
||||
compiler_globals->empty_string = zend_string_alloc(sizeof("")-1, 1);
|
||||
compiler_globals->empty_string->val[0] = '\000';
|
||||
zend_string_hash_val(compiler_globals->empty_string);
|
||||
compiler_globals->empty_string->gc.u.v.flags |= IS_STR_INTERNED;
|
||||
zend_interned_empty_string_init(&compiler_globals->empty_string TSRMLS_CC);
|
||||
|
||||
memset(compiler_globals->one_char_string, 0, sizeof(compiler_globals->one_char_string));
|
||||
#endif
|
||||
|
@ -478,7 +475,7 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS
|
|||
compiler_globals->last_static_member = 0;
|
||||
|
||||
#ifdef ZTS
|
||||
zend_string_release(compiler_globals->empty_string);
|
||||
zend_interned_empty_string_free(&compiler_globals->empty_string TSRMLS_CC);
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
|
|
@ -1977,22 +1977,22 @@ void zend_mm_shutdown(zend_mm_heap *heap, int full, int silent TSRMLS_DC)
|
|||
/* PUBLIC API */
|
||||
/**************/
|
||||
|
||||
ZEND_API void *_zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
ZEND_API void* ZEND_FASTCALL _zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
return zend_mm_alloc_heap(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
|
||||
ZEND_API void _zend_mm_free(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
ZEND_API void ZEND_FASTCALL _zend_mm_free(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
zend_mm_free_heap(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
|
||||
void *_zend_mm_realloc(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
void* ZEND_FASTCALL _zend_mm_realloc(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
return zend_mm_realloc_heap(heap, ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
|
||||
ZEND_API size_t _zend_mm_block_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
ZEND_API size_t ZEND_FASTCALL _zend_mm_block_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
return zend_mm_size(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
|
|
|
@ -238,10 +238,10 @@ typedef struct _zend_mm_heap zend_mm_heap;
|
|||
|
||||
ZEND_API zend_mm_heap *zend_mm_startup(void);
|
||||
ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent TSRMLS_DC);
|
||||
ZEND_API void *_zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
|
||||
ZEND_API void _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API void *_zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API size_t _zend_mm_block_size(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API void* ZEND_FASTCALL _zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
|
||||
ZEND_API void ZEND_FASTCALL _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API void* ZEND_FASTCALL _zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API size_t ZEND_FASTCALL _zend_mm_block_size(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
|
||||
#define zend_mm_alloc(heap, size) _zend_mm_alloc((heap), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define zend_mm_free(heap, p) _zend_mm_free((heap), (p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
|
|
|
@ -45,9 +45,9 @@ static void _str_dtor(zval *zv)
|
|||
|
||||
void zend_interned_strings_init(TSRMLS_D)
|
||||
{
|
||||
#ifndef ZTS
|
||||
zend_string *str;
|
||||
|
||||
#ifndef ZTS
|
||||
zend_hash_init(&CG(interned_strings), 1024, NULL, _str_dtor, 1);
|
||||
|
||||
CG(interned_strings).nTableMask = CG(interned_strings).nTableSize - 1;
|
||||
|
@ -59,12 +59,6 @@ void zend_interned_strings_init(TSRMLS_D)
|
|||
str = zend_string_alloc(sizeof("")-1, 1);
|
||||
str->val[0] = '\000';
|
||||
CG(empty_string) = zend_new_interned_string_int(str TSRMLS_CC);
|
||||
#else
|
||||
str = zend_string_alloc(sizeof("")-1, 1);
|
||||
str->val[0] = '\000';
|
||||
zend_string_hash_val(str);
|
||||
str->gc.u.v.flags |= IS_STR_INTERNED;
|
||||
CG(empty_string) = str;
|
||||
#endif
|
||||
|
||||
/* one char strings (the actual interned strings are going to be created by ext/opcache) */
|
||||
|
@ -79,8 +73,6 @@ void zend_interned_strings_dtor(TSRMLS_D)
|
|||
{
|
||||
#ifndef ZTS
|
||||
zend_hash_destroy(&CG(interned_strings));
|
||||
#else
|
||||
zend_string_release(CG(empty_string));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -282,6 +282,30 @@ EMPTY_SWITCH_DEFAULT_CASE()
|
|||
return hash;
|
||||
}
|
||||
|
||||
static zend_always_inline void zend_interned_empty_string_init(zend_string **s TSRMLS_DC)
|
||||
{
|
||||
zend_string *str;
|
||||
|
||||
str = zend_string_alloc(sizeof("")-1, 1);
|
||||
str->val[0] = '\000';
|
||||
|
||||
#ifndef ZTS
|
||||
*s = zend_new_interned_string(str TSRMLS_CC);
|
||||
#else
|
||||
zend_string_hash_val(str);
|
||||
str->gc.u.v.flags |= IS_STR_INTERNED;
|
||||
*s = str;
|
||||
#endif
|
||||
}
|
||||
|
||||
static zend_always_inline void zend_interned_empty_string_free(zend_string **s TSRMLS_DC)
|
||||
{
|
||||
if (NULL != *s) {
|
||||
free(*s);
|
||||
*s = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ZEND_STRING_H */
|
||||
|
||||
/*
|
||||
|
|
|
@ -76,8 +76,6 @@ static php_stream_filter_status_t php_zlib_inflate_filter(
|
|||
while (buckets_in->head) {
|
||||
size_t bin = 0, desired;
|
||||
|
||||
bucket = buckets_in->head;
|
||||
|
||||
bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC);
|
||||
|
||||
while (bin < (unsigned int) bucket->buflen) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* automatically generated by configure */
|
||||
/* edit configure.in to change version number */
|
||||
#define PHP_MAJOR_VERSION 5
|
||||
#define PHP_MINOR_VERSION 7
|
||||
#define PHP_MAJOR_VERSION 7
|
||||
#define PHP_MINOR_VERSION 0
|
||||
#define PHP_RELEASE_VERSION 0
|
||||
#define PHP_EXTRA_VERSION "-dev"
|
||||
#define PHP_VERSION "5.7.0-dev"
|
||||
#define PHP_VERSION_ID 50700
|
||||
#define PHP_VERSION "7.0.0-dev"
|
||||
#define PHP_VERSION_ID 70000
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue