mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-07 09:17:29 +00:00
Remove zend_set_memory_limit_ex() API
This was added temporarily for the PHP-8.0 branch to avoid an ABI break.
This commit is contained in:
1 parent
b4559e7ae4
commit
1aafed5e98
3 files changed
+3
-11
No files matched your search
+1
-8
@@ -2658,7 +2658,7 @@ ZEND_API char* ZEND_FASTCALL zend_strndup(const char *s, size_t length)
|
||||
return p;
|
||||
}
|
||||
|
||||
ZEND_API zend_result zend_set_memory_limit_ex(size_t memory_limit)
|
||||
ZEND_API zend_result zend_set_memory_limit(size_t memory_limit)
|
||||
{
|
||||
#if ZEND_MM_LIMIT
|
||||
if (memory_limit < ZEND_MM_CHUNK_SIZE) {
|
||||
@@ -2672,13 +2672,6 @@ ZEND_API zend_result zend_set_memory_limit_ex(size_t memory_limit)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
ZEND_API void zend_set_memory_limit(size_t memory_limit)
|
||||
{
|
||||
#if ZEND_MM_LIMIT
|
||||
AG(mm_heap)->limit = memory_limit >= ZEND_MM_CHUNK_SIZE ? memory_limit : ZEND_MM_CHUNK_SIZE;
|
||||
#endif
|
||||
}
|
||||
|
||||
ZEND_API size_t zend_memory_usage(bool real_usage)
|
||||
{
|
||||
#if ZEND_MM_STAT
|
||||
|
||||
+1
-2
@@ -219,8 +219,7 @@ ZEND_API void * __zend_realloc(void *p, size_t len) ZEND_ATTRIBUTE_ALLOC_SIZE(2)
|
||||
#define perealloc2_recoverable_rel(ptr, size, copy_size, persistent) ((persistent)?realloc((ptr), (size)):erealloc2_recoverable_rel((ptr), (size), (copy_size)))
|
||||
#define pestrdup_rel(s, persistent) ((persistent)?strdup(s):estrdup_rel(s))
|
||||
|
||||
ZEND_API void zend_set_memory_limit(size_t memory_limit);
|
||||
ZEND_API zend_result zend_set_memory_limit_ex(size_t memory_limit);
|
||||
ZEND_API zend_result zend_set_memory_limit(size_t memory_limit);
|
||||
|
||||
ZEND_API void start_memory_manager(void);
|
||||
ZEND_API void shutdown_memory_manager(bool silent, bool full_shutdown);
|
||||
|
||||
+1
-1
@@ -272,7 +272,7 @@ static PHP_INI_MH(OnChangeMemoryLimit)
|
||||
} else {
|
||||
value = Z_L(1)<<30; /* effectively, no limit */
|
||||
}
|
||||
if (zend_set_memory_limit_ex(value) == FAILURE) {
|
||||
if (zend_set_memory_limit(value) == FAILURE) {
|
||||
zend_error(E_WARNING, "Failed to set memory limit to %zd bytes (Current memory usage is %zd bytes)", value, zend_memory_usage(true));
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user