Lines Matching refs:heap

237 	HANDLE heap = HeapCreate(HEAP_NO_SERIALIZE, 0, 0);  in zend_mm_mem_win32_init()  local
240 if (heap == NULL) { in zend_mm_mem_win32_init()
245 HeapDestroy(heap); in zend_mm_mem_win32_init()
248 storage->data = (void*) heap; in zend_mm_mem_win32_init()
320 # define ZEND_MM_STORAGE_DTOR() heap->storage->handlers->dtor(heap->storage)
321 # define ZEND_MM_STORAGE_ALLOC(size) heap->storage->handlers->_alloc(heap->storage, size)
322 # define ZEND_MM_STORAGE_REALLOC(ptr, size) heap->storage->handlers->_realloc(heap->storage, ptr,…
323 # define ZEND_MM_STORAGE_FREE(ptr) heap->storage->handlers->_free(heap->storage, ptr)
453 #define ZEND_MM_SMALL_FREE_BUCKET(heap, index) \ argument
454 (zend_mm_free_block*) ((char*)&heap->free_buckets[index * 2] + \
458 #define ZEND_MM_REST_BUCKET(heap) \ argument
459 (zend_mm_free_block*)((char*)&heap->rest_buckets[0] + \
563 zend_mm_check_ptr(heap, block, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)
661 static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_OR…
662 static void _zend_mm_free_int(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
663 static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_F…
723 static inline void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) in zend_mm_add_to_free_list() argument
735 p = &heap->large_free_buckets[index]; in zend_mm_add_to_free_list()
741 heap->large_free_bitmap |= (ZEND_MM_LONG_CONST(1) << index); in zend_mm_add_to_free_list()
772 prev = ZEND_MM_SMALL_FREE_BUCKET(heap, index); in zend_mm_add_to_free_list()
774 heap->free_bitmap |= (ZEND_MM_LONG_CONST(1) << index); in zend_mm_add_to_free_list()
784 static inline void zend_mm_remove_from_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) in zend_mm_remove_from_free_list() argument
807 if (mm_block->parent == &heap->large_free_buckets[index]) { in zend_mm_remove_from_free_list()
808 heap->large_free_bitmap &= ~(ZEND_MM_LONG_CONST(1) << index); in zend_mm_remove_from_free_list()
845 if (EXPECTED(heap->free_buckets[index*2] == heap->free_buckets[index*2+1])) { in zend_mm_remove_from_free_list()
846 heap->free_bitmap &= ~(ZEND_MM_LONG_CONST(1) << index); in zend_mm_remove_from_free_list()
850 heap->rest_count--; in zend_mm_remove_from_free_list()
857 static inline void zend_mm_add_to_rest_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) in zend_mm_add_to_rest_list() argument
861 while (heap->rest_count >= ZEND_MM_MAX_REST_BLOCKS) { in zend_mm_add_to_rest_list()
862 zend_mm_free_block *p = heap->rest_buckets[1]; in zend_mm_add_to_rest_list()
865 heap->rest_count--; in zend_mm_add_to_rest_list()
871 zend_mm_add_to_free_list(heap, p); in zend_mm_add_to_rest_list()
876 heap->rest_count++; in zend_mm_add_to_rest_list()
881 prev = heap->rest_buckets[0]; in zend_mm_add_to_rest_list()
888 static inline void zend_mm_init(zend_mm_heap *heap) in zend_mm_init() argument
893 heap->free_bitmap = 0; in zend_mm_init()
894 heap->large_free_bitmap = 0; in zend_mm_init()
896 heap->cached = 0; in zend_mm_init()
897 memset(heap->cache, 0, sizeof(heap->cache)); in zend_mm_init()
901 heap->cache_stat[i].count = 0; in zend_mm_init()
904 p = ZEND_MM_SMALL_FREE_BUCKET(heap, 0); in zend_mm_init()
909 heap->large_free_buckets[i] = NULL; in zend_mm_init()
911 heap->rest_buckets[0] = heap->rest_buckets[1] = ZEND_MM_REST_BUCKET(heap); in zend_mm_init()
912 heap->rest_count = 0; in zend_mm_init()
915 static void zend_mm_del_segment(zend_mm_heap *heap, zend_mm_segment *segment) in zend_mm_del_segment() argument
917 zend_mm_segment **p = &heap->segments_list; in zend_mm_del_segment()
923 heap->real_size -= segment->size; in zend_mm_del_segment()
928 static void zend_mm_free_cache(zend_mm_heap *heap) in zend_mm_free_cache() argument
933 if (heap->cache[i]) { in zend_mm_free_cache()
934 zend_mm_free_block *mm_block = heap->cache[i]; in zend_mm_free_cache()
941 heap->cached -= size; in zend_mm_free_cache()
946 zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) mm_block); in zend_mm_free_cache()
950 zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block); in zend_mm_free_cache()
956 … zend_mm_del_segment(heap, (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE)); in zend_mm_free_cache()
958 zend_mm_add_to_free_list(heap, (zend_mm_free_block *) mm_block); in zend_mm_free_cache()
963 heap->cache[i] = NULL; in zend_mm_free_cache()
965 heap->cache_stat[i].count = 0; in zend_mm_free_cache()
1041 zend_mm_heap *heap; in zend_mm_startup_ex() local
1094 heap = malloc(sizeof(struct _zend_mm_heap)); in zend_mm_startup_ex()
1095 if (heap == NULL) { in zend_mm_startup_ex()
1102 heap->storage = storage; in zend_mm_startup_ex()
1103 heap->block_size = block_size; in zend_mm_startup_ex()
1104 heap->compact_size = 0; in zend_mm_startup_ex()
1105 heap->segments_list = NULL; in zend_mm_startup_ex()
1106 zend_mm_init(heap); in zend_mm_startup_ex()
1108 memset(heap->cache_stat, 0, sizeof(heap->cache_stat)); in zend_mm_startup_ex()
1111 heap->use_zend_alloc = 1; in zend_mm_startup_ex()
1112 heap->real_size = 0; in zend_mm_startup_ex()
1113 heap->overflow = 0; in zend_mm_startup_ex()
1114 heap->real_peak = 0; in zend_mm_startup_ex()
1115 heap->limit = ZEND_MM_LONG_CONST(1)<<(ZEND_MM_NUM_BUCKETS-2); in zend_mm_startup_ex()
1116 heap->size = 0; in zend_mm_startup_ex()
1117 heap->peak = 0; in zend_mm_startup_ex()
1118 heap->internal = internal; in zend_mm_startup_ex()
1119 heap->reserve = NULL; in zend_mm_startup_ex()
1120 heap->reserve_size = reserve_size; in zend_mm_startup_ex()
1122 heap->reserve = _zend_mm_alloc_int(heap, reserve_size ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); in zend_mm_startup_ex()
1127 …zend_mm_heap *mm_heap = _zend_mm_alloc_int(heap, sizeof(zend_mm_heap) ZEND_FILE_LINE_CC ZEND_FILE… in zend_mm_startup_ex()
1129 *mm_heap = *heap; in zend_mm_startup_ex()
1132 orig = ZEND_MM_SMALL_FREE_BUCKET(heap, 0); in zend_mm_startup_ex()
1153 free(heap); in zend_mm_startup_ex()
1154 heap = mm_heap; in zend_mm_startup_ex()
1156 return heap; in zend_mm_startup_ex()
1166 zend_mm_heap *heap; in zend_mm_startup() local
1217 heap = zend_mm_startup_ex(handlers, seg_size, ZEND_MM_RESERVE_SIZE, 0, NULL); in zend_mm_startup()
1218 if (heap) { in zend_mm_startup()
1221 heap->compact_size = zend_atoi(tmp, 0); in zend_mm_startup()
1223 heap->compact_size = 2 * 1024 * 1024; in zend_mm_startup()
1226 return heap; in zend_mm_startup()
1271 static void zend_mm_check_leaks(zend_mm_heap *heap TSRMLS_DC) in zend_mm_check_leaks()
1273 zend_mm_segment *segment = heap->segments_list; in zend_mm_check_leaks()
1331 static int zend_mm_check_ptr(zend_mm_heap *heap, void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_… in zend_mm_check_ptr() argument
1363 return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in zend_mm_check_ptr()
1375 return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in zend_mm_check_ptr()
1385 return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in zend_mm_check_ptr()
1394 return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in zend_mm_check_ptr()
1416 return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in zend_mm_check_ptr()
1427 return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in zend_mm_check_ptr()
1443 return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in zend_mm_check_ptr()
1451 return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in zend_mm_check_ptr()
1459 return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in zend_mm_check_ptr()
1468 return zend_mm_check_ptr(heap, ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in zend_mm_check_ptr()
1555 static int zend_mm_check_heap(zend_mm_heap *heap, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_… in zend_mm_check_heap() argument
1557 zend_mm_segment *segment = heap->segments_list; in zend_mm_check_heap()
1574 …if (!zend_mm_check_ptr(heap, ZEND_MM_DATA_OF(p), (silent?2:3) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LI… in zend_mm_check_heap()
1597 ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent TSRMLS_DC) in zend_mm_shutdown() argument
1604 if (!heap->use_zend_alloc) { in zend_mm_shutdown()
1606 free(heap); in zend_mm_shutdown()
1611 if (heap->reserve) { in zend_mm_shutdown()
1614 _zend_mm_free_int(heap, heap->reserve ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); in zend_mm_shutdown()
1617 heap->reserve = NULL; in zend_mm_shutdown()
1652 hit += heap->cache_stat[i].hit; in zend_mm_shutdown()
1653 miss += heap->cache_stat[i].miss; in zend_mm_shutdown()
1654 …, (int)max_size, ZEND_MM_TRUE_SIZE(max_size), heap->cache_stat[i].max_count, heap->cache_stat[i].h… in zend_mm_shutdown()
1660 …" %8d %8d\n", heap->cache_stat[ZEND_MM_NUM_BUCKETS].hit, he… in zend_mm_shutdown()
1668 zend_mm_check_leaks(heap TSRMLS_CC); in zend_mm_shutdown()
1672 internal = heap->internal; in zend_mm_shutdown()
1673 storage = heap->storage; in zend_mm_shutdown()
1674 segment = heap->segments_list; in zend_mm_shutdown()
1681 heap->segments_list = NULL; in zend_mm_shutdown()
1684 free(heap); in zend_mm_shutdown()
1689 if (heap->reserve_size) { in zend_mm_shutdown()
1695 heap->segments_list = segment; in zend_mm_shutdown()
1703 heap->segments_list = NULL; in zend_mm_shutdown()
1708 if (heap->compact_size && in zend_mm_shutdown()
1709 heap->real_peak > heap->compact_size) { in zend_mm_shutdown()
1712 zend_mm_init(heap); in zend_mm_shutdown()
1713 if (heap->segments_list) { in zend_mm_shutdown()
1714 heap->real_size = heap->segments_list->size; in zend_mm_shutdown()
1715 heap->real_peak = heap->segments_list->size; in zend_mm_shutdown()
1717 heap->real_size = 0; in zend_mm_shutdown()
1718 heap->real_peak = 0; in zend_mm_shutdown()
1720 heap->size = 0; in zend_mm_shutdown()
1721 heap->peak = 0; in zend_mm_shutdown()
1722 if (heap->segments_list) { in zend_mm_shutdown()
1724 …zend_mm_free_block *b = (zend_mm_free_block*)((char*)heap->segments_list + ZEND_MM_ALIGNED_SEGMENT… in zend_mm_shutdown()
1725 …size_t block_size = heap->segments_list->size - ZEND_MM_ALIGNED_SEGMENT_SIZE - ZEND_MM_ALIGNED_HEA… in zend_mm_shutdown()
1730 zend_mm_add_to_free_list(heap, b); in zend_mm_shutdown()
1732 if (heap->reserve_size) { in zend_mm_shutdown()
1733heap->reserve = _zend_mm_alloc_int(heap, heap->reserve_size ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPT… in zend_mm_shutdown()
1735 heap->overflow = 0; in zend_mm_shutdown()
1739 static void zend_mm_safe_error(zend_mm_heap *heap, in zend_mm_safe_error() argument
1748 if (heap->reserve) { in zend_mm_safe_error()
1749 _zend_mm_free_int(heap, heap->reserve ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); in zend_mm_safe_error()
1750 heap->reserve = NULL; in zend_mm_safe_error()
1752 if (heap->overflow == 0) { in zend_mm_safe_error()
1769 heap->overflow = 1; in zend_mm_safe_error()
1780 if (heap->overflow == 2) { in zend_mm_safe_error()
1798 heap->overflow = 2; in zend_mm_safe_error()
1803 static zend_mm_free_block *zend_mm_search_large_block(zend_mm_heap *heap, size_t true_size) in zend_mm_search_large_block() argument
1807 size_t bitmap = heap->large_free_bitmap >> index; in zend_mm_search_large_block()
1821 p = heap->large_free_buckets[index]; in zend_mm_search_large_block()
1867 best_fit = p = heap->large_free_buckets[index + zend_mm_low_bit(bitmap)]; in zend_mm_search_large_block()
1876 static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_OR… in _zend_mm_alloc_int() argument
1899 if (EXPECTED(heap->cache[index] != NULL)) { in _zend_mm_alloc_int()
1902 heap->cache_stat[index].count--; in _zend_mm_alloc_int()
1903 heap->cache_stat[index].hit++; in _zend_mm_alloc_int()
1905 best_fit = heap->cache[index]; in _zend_mm_alloc_int()
1906 heap->cache[index] = best_fit->prev_free_block; in _zend_mm_alloc_int()
1907 heap->cached -= true_size; in _zend_mm_alloc_int()
1914 heap->cache_stat[index].miss++; in _zend_mm_alloc_int()
1918 bitmap = heap->free_bitmap >> index; in _zend_mm_alloc_int()
1922 best_fit = heap->free_buckets[index*2]; in _zend_mm_alloc_int()
1924 heap->cache_stat[ZEND_MM_NUM_BUCKETS].hit++; in _zend_mm_alloc_int()
1931 heap->cache_stat[ZEND_MM_NUM_BUCKETS].miss++; in _zend_mm_alloc_int()
1934 best_fit = zend_mm_search_large_block(heap, true_size); in _zend_mm_alloc_int()
1936 if (!best_fit && heap->real_size >= heap->limit - heap->block_size) { in _zend_mm_alloc_int()
1937 zend_mm_free_block *p = heap->rest_buckets[0]; in _zend_mm_alloc_int()
1940 while (p != ZEND_MM_REST_BUCKET(heap)) { in _zend_mm_alloc_int()
1954 if (true_size > heap->block_size - (ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE)) { in _zend_mm_alloc_int()
1958 segment_size = (segment_size + (heap->block_size-1)) & ~(heap->block_size-1); in _zend_mm_alloc_int()
1961 segment_size = heap->block_size; in _zend_mm_alloc_int()
1965 heap->real_size + segment_size > heap->limit) { in _zend_mm_alloc_int()
1968 zend_mm_free_cache(heap); in _zend_mm_alloc_int()
1972 …zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted at %s:%d (tried to allocate %… in _zend_mm_alloc_int()
1974 …zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted (tried to allocate %lu bytes)… in _zend_mm_alloc_int()
1983 zend_mm_free_cache(heap); in _zend_mm_alloc_int()
1988 …zend_mm_safe_error(heap, "Out of memory (allocated %ld) at %s:%d (tried to allocate %lu bytes)", h… in _zend_mm_alloc_int()
1990 …zend_mm_safe_error(heap, "Out of memory (allocated %ld) (tried to allocate %lu bytes)", heap->real… in _zend_mm_alloc_int()
1995 heap->real_size += segment_size; in _zend_mm_alloc_int()
1996 if (heap->real_size > heap->real_peak) { in _zend_mm_alloc_int()
1997 heap->real_peak = heap->real_size; in _zend_mm_alloc_int()
2001 segment->next_segment = heap->segments_list; in _zend_mm_alloc_int()
2002 heap->segments_list = segment; in _zend_mm_alloc_int()
2017 zend_mm_remove_from_free_list(heap, best_fit); in _zend_mm_alloc_int()
2037 zend_mm_add_to_free_list(heap, new_free_block); in _zend_mm_alloc_int()
2039 zend_mm_add_to_rest_list(heap, new_free_block); in _zend_mm_alloc_int()
2045 heap->size += true_size; in _zend_mm_alloc_int()
2046 if (heap->peak < heap->size) { in _zend_mm_alloc_int()
2047 heap->peak = heap->size; in _zend_mm_alloc_int()
2056 static void _zend_mm_free_int(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) in _zend_mm_free_int() argument
2079 if (EXPECTED(ZEND_MM_SMALL_SIZE(size)) && EXPECTED(heap->cached < ZEND_MM_CACHE_SIZE)) { in _zend_mm_free_int()
2081 zend_mm_free_block **cache = &heap->cache[index]; in _zend_mm_free_int()
2085 heap->cached += size; in _zend_mm_free_int()
2088 if (++heap->cache_stat[index].count > heap->cache_stat[index].max_count) { in _zend_mm_free_int()
2089 heap->cache_stat[index].max_count = heap->cache_stat[index].count; in _zend_mm_free_int()
2097 heap->size -= size; in _zend_mm_free_int()
2101 zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block); in _zend_mm_free_int()
2106 zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) mm_block); in _zend_mm_free_int()
2111 zend_mm_del_segment(heap, (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE)); in _zend_mm_free_int()
2114 zend_mm_add_to_free_list(heap, (zend_mm_free_block *) mm_block); in _zend_mm_free_int()
2119 static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_F… in _zend_mm_realloc_int() argument
2130 return _zend_mm_alloc_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in _zend_mm_realloc_int()
2153 zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block); in _zend_mm_realloc_int()
2163 zend_mm_add_to_free_list(heap, new_free_block); in _zend_mm_realloc_int()
2164 heap->size += (true_size - orig_size); in _zend_mm_realloc_int()
2175 if (heap->cache[index] != NULL) { in _zend_mm_realloc_int()
2180 heap->cache_stat[index].count--; in _zend_mm_realloc_int()
2181 heap->cache_stat[index].hit++; in _zend_mm_realloc_int()
2183 best_fit = heap->cache[index]; in _zend_mm_realloc_int()
2184 heap->cache[index] = best_fit->prev_free_block; in _zend_mm_realloc_int()
2196 heap->cached -= true_size - orig_size; in _zend_mm_realloc_int()
2199 cache = &heap->cache[index]; in _zend_mm_realloc_int()
2205 if (++heap->cache_stat[index].count > heap->cache_stat[index].max_count) { in _zend_mm_realloc_int()
2206 heap->cache_stat[index].max_count = heap->cache_stat[index].count; in _zend_mm_realloc_int()
2225 zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block); in _zend_mm_realloc_int()
2241 zend_mm_add_to_rest_list(heap, new_free_block); in _zend_mm_realloc_int()
2243 zend_mm_add_to_free_list(heap, new_free_block); in _zend_mm_realloc_int()
2247 heap->size = heap->size + true_size - orig_size; in _zend_mm_realloc_int()
2248 if (heap->peak < heap->size) { in _zend_mm_realloc_int()
2249 heap->peak = heap->size; in _zend_mm_realloc_int()
2255 zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block); in _zend_mm_realloc_int()
2267 if (true_size > heap->block_size - (ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE)) { in _zend_mm_realloc_int()
2269 segment_size = (segment_size + (heap->block_size-1)) & ~(heap->block_size-1); in _zend_mm_realloc_int()
2271 segment_size = heap->block_size; in _zend_mm_realloc_int()
2276 heap->real_size + segment_size - segment_copy->size > heap->limit) { in _zend_mm_realloc_int()
2278 zend_mm_add_to_free_list(heap, (zend_mm_free_block *) next_block); in _zend_mm_realloc_int()
2281 zend_mm_free_cache(heap); in _zend_mm_realloc_int()
2285 …zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted at %s:%d (tried to allocate %… in _zend_mm_realloc_int()
2287 …zend_mm_safe_error(heap, "Allowed memory size of %ld bytes exhausted (tried to allocate %ld bytes)… in _zend_mm_realloc_int()
2295 zend_mm_free_cache(heap); in _zend_mm_realloc_int()
2300 …zend_mm_safe_error(heap, "Out of memory (allocated %ld) at %s:%d (tried to allocate %ld bytes)", h… in _zend_mm_realloc_int()
2302 …zend_mm_safe_error(heap, "Out of memory (allocated %ld) (tried to allocate %ld bytes)", heap->real… in _zend_mm_realloc_int()
2306 heap->real_size += segment_size - segment->size; in _zend_mm_realloc_int()
2307 if (heap->real_size > heap->real_peak) { in _zend_mm_realloc_int()
2308 heap->real_peak = heap->real_size; in _zend_mm_realloc_int()
2314 zend_mm_segment **seg = &heap->segments_list; in _zend_mm_realloc_int()
2341 zend_mm_add_to_rest_list(heap, new_free_block); in _zend_mm_realloc_int()
2346 heap->size = heap->size + true_size - orig_size; in _zend_mm_realloc_int()
2347 if (heap->peak < heap->size) { in _zend_mm_realloc_int()
2348 heap->peak = heap->size; in _zend_mm_realloc_int()
2355 ptr = _zend_mm_alloc_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in _zend_mm_realloc_int()
2361 _zend_mm_free_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in _zend_mm_realloc_int()
2366 ZEND_API void *_zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG… in _zend_mm_alloc() argument
2368 return _zend_mm_alloc_int(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in _zend_mm_alloc()
2371 ZEND_API void _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) in _zend_mm_free() argument
2373 _zend_mm_free_int(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in _zend_mm_free()
2376 ZEND_API void *_zend_mm_realloc(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_F… in _zend_mm_realloc() argument
2378 return _zend_mm_realloc_int(heap, ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); in _zend_mm_realloc()
2381 ZEND_API size_t _zend_mm_block_size(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_OR… in _zend_mm_block_size() argument
2718 ZEND_API zend_mm_storage *zend_mm_get_storage(zend_mm_heap *heap) in zend_mm_get_storage() argument
2720 return heap->storage; in zend_mm_get_storage()
2723 ZEND_API void zend_mm_set_custom_handlers(zend_mm_heap *heap, in zend_mm_set_custom_handlers() argument
2728 heap->use_zend_alloc = 0; in zend_mm_set_custom_handlers()
2729 heap->_malloc = _malloc; in zend_mm_set_custom_handlers()
2730 heap->_free = _free; in zend_mm_set_custom_handlers()
2731 heap->_realloc = _realloc; in zend_mm_set_custom_handlers()