Skip to content

Commit 3eb6d65

Browse files
committed
Fix memory_limit, kill warning
1 parent 446567c commit 3eb6d65

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Zend/zend_alloc.c

+5
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,11 @@ ZEND_API int zend_set_memory_limit(unsigned int memory_limit)
386386

387387
ZEND_API void start_memory_manager(ALS_D)
388388
{
389+
#if 0
389390
#ifndef ZTS
390391
int i, j;
391392
void *cached_entries[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
393+
#endif
392394
#endif
393395

394396
AG(phead) = AG(head) = NULL;
@@ -454,6 +456,9 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
454456

455457
for (i=1; i<MAX_CACHED_MEMORY; i++) {
456458
for (j=0; j<AG(cache_count)[i]; j++) {
459+
#if MEMORY_LIMIT
460+
AG(allocated_memory) -= REAL_SIZE(ptr->size);
461+
#endif
457462
ptr = (zend_mem_header *) AG(cache)[i][j];
458463
REMOVE_POINTER_FROM_LIST(ptr);
459464
free(ptr);

0 commit comments

Comments
 (0)