Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Eliminated the TSRMLS_FETCH() in zend_set_memory_limit()

  • Loading branch information...
commit 9e3551ba1f00baa4a14215fda0c5d28aecfcdeba 1 parent f046189
@KalleZ KalleZ authored
View
2  UPGRADING.INTERNALS
@@ -17,6 +17,8 @@ UPGRADE NOTES - PHP X.Y
1. Internal API changes
========================
+ a. zend_set_memory_limit() now takes the TSRMLS_CC macro as its last argument
+
========================
2. Build system changes
View
4 Zend/zend_alloc.c
@@ -2682,10 +2682,8 @@ ZEND_API char *zend_strndup(const char *s, uint length)
}
-ZEND_API int zend_set_memory_limit(size_t memory_limit)
+ZEND_API int zend_set_memory_limit(size_t memory_limit TSRMLS_DC)
{
- TSRMLS_FETCH();
-
AG(mm_heap)->limit = (memory_limit >= AG(mm_heap)->block_size) ? memory_limit : AG(mm_heap)->block_size;
return SUCCESS;
View
2  Zend/zend_alloc.h
@@ -139,7 +139,7 @@ inline static void * __zend_realloc(void *p, size_t len)
#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):STR_EMPTY_ALLOC())
#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):STR_EMPTY_ALLOC())
-ZEND_API int zend_set_memory_limit(size_t memory_limit);
+ZEND_API int zend_set_memory_limit(size_t memory_limit TSRMLS_DC);
ZEND_API void start_memory_manager(TSRMLS_D);
ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC);
View
4 main/main.c
@@ -179,7 +179,7 @@ static PHP_INI_MH(OnChangeMemoryLimit)
} else {
PG(memory_limit) = 1<<30; /* effectively, no limit */
}
- return zend_set_memory_limit(PG(memory_limit));
+ return zend_set_memory_limit(PG(memory_limit) TSRMLS_CC);
}
/* }}} */
@@ -1166,7 +1166,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
CG(parse_error) = 0;
} else {
/* restore memory limit */
- zend_set_memory_limit(PG(memory_limit));
+ zend_set_memory_limit(PG(memory_limit) TSRMLS_CC);
efree(buffer);
zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC);
zend_bailout();
Please sign in to comment.
Something went wrong with that request. Please try again.