Lines Matching refs:heap
282 zend_mm_heap *heap; member
368 static ZEND_COLD ZEND_NORETURN void zend_mm_safe_error(zend_mm_heap *heap, in zend_mm_safe_error() argument
378 heap->overflow = 1; in zend_mm_safe_error()
390 heap->overflow = 0; in zend_mm_safe_error()
753 static void *zend_mm_chunk_alloc(zend_mm_heap *heap, size_t size, size_t alignment) argument
756 if (UNEXPECTED(heap->storage)) {
757 void *ptr = heap->storage->handlers.chunk_alloc(heap->storage, size, alignment);
765 static void zend_mm_chunk_free(zend_mm_heap *heap, void *addr, size_t size) argument
768 if (UNEXPECTED(heap->storage)) {
769 heap->storage->handlers.chunk_free(heap->storage, addr, size);
776 static int zend_mm_chunk_truncate(zend_mm_heap *heap, void *addr, size_t old_size, size_t new_size) argument
779 if (UNEXPECTED(heap->storage)) {
780 if (heap->storage->handlers.chunk_truncate) {
781 return heap->storage->handlers.chunk_truncate(heap->storage, addr, old_size, new_size);
795 static int zend_mm_chunk_extend(zend_mm_heap *heap, void *addr, size_t old_size, size_t new_size) argument
798 if (UNEXPECTED(heap->storage)) {
799 if (heap->storage->handlers.chunk_extend) {
800 return heap->storage->handlers.chunk_extend(heap->storage, addr, old_size, new_size);
813 static zend_always_inline void zend_mm_chunk_init(zend_mm_heap *heap, zend_mm_chunk *chunk) argument
815 chunk->heap = heap;
816 chunk->next = heap->main_chunk;
817 chunk->prev = heap->main_chunk->prev;
834 static size_t zend_mm_get_huge_block_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE…
835 static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_OR…
836 static void zend_mm_free_huge(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_D…
839 static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t size, size_t dbg_s…
841 static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LIN…
849 static void *zend_mm_alloc_pages(zend_mm_heap *heap, uint32_t pages_count, size_t size ZEND_FILE_LI… argument
851 static void *zend_mm_alloc_pages(zend_mm_heap *heap, uint32_t pages_count ZEND_FILE_LINE_DC ZEND_FI…
854 zend_mm_chunk *chunk = heap->main_chunk;
973 if (chunk->next == heap->main_chunk) {
975 if (heap->cached_chunks) {
976 heap->cached_chunks_count--;
977 chunk = heap->cached_chunks;
978 heap->cached_chunks = chunk->next;
981 if (UNEXPECTED(heap->real_size + ZEND_MM_CHUNK_SIZE > heap->limit)) {
982 if (zend_mm_gc(heap)) {
984 } else if (heap->overflow == 0) {
986 …zend_mm_safe_error(heap, "Allowed memory size of %zu bytes exhausted at %s:%d (tried to allocate %…
988 …zend_mm_safe_error(heap, "Allowed memory size of %zu bytes exhausted (tried to allocate %zu bytes)…
994 chunk = (zend_mm_chunk*)zend_mm_chunk_alloc(heap, ZEND_MM_CHUNK_SIZE, ZEND_MM_CHUNK_SIZE);
997 if (zend_mm_gc(heap) &&
998 …(chunk = (zend_mm_chunk*)zend_mm_chunk_alloc(heap, ZEND_MM_CHUNK_SIZE, ZEND_MM_CHUNK_SIZE)) != NUL…
1002 zend_mm_safe_error(heap, "Out of memory");
1004 …zend_mm_safe_error(heap, "Out of memory (allocated %zu) at %s:%d (tried to allocate %zu bytes)", h…
1006 …zend_mm_safe_error(heap, "Out of memory (allocated %zu) (tried to allocate %zu bytes)", heap->real…
1013 size_t size = heap->real_size + ZEND_MM_CHUNK_SIZE;
1014 size_t peak = MAX(heap->real_peak, size);
1015 heap->real_size = size;
1016 heap->real_peak = peak;
1019 heap->real_size += ZEND_MM_CHUNK_SIZE;
1023 heap->chunks_count++;
1024 if (heap->chunks_count > heap->peak_chunks_count) {
1025 heap->peak_chunks_count = heap->chunks_count;
1027 zend_mm_chunk_init(heap, chunk);
1042 chunk->next = heap->main_chunk->next;
1043 chunk->prev = heap->main_chunk;
1057 static zend_always_inline void *zend_mm_alloc_large(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_… argument
1061 …void *ptr = zend_mm_alloc_pages(heap, pages_count, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORI…
1063 …void *ptr = zend_mm_alloc_pages(heap, pages_count ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELA…
1067 size_t size = heap->size + pages_count * ZEND_MM_PAGE_SIZE;
1068 size_t peak = MAX(heap->peak, size);
1069 heap->size = size;
1070 heap->peak = peak;
1076 static zend_always_inline void zend_mm_delete_chunk(zend_mm_heap *heap, zend_mm_chunk *chunk) argument
1080 heap->chunks_count--;
1081 if (heap->chunks_count + heap->cached_chunks_count < heap->avg_chunks_count + 0.1
1082 || (heap->chunks_count == heap->last_chunks_delete_boundary
1083 && heap->last_chunks_delete_count >= 4)) {
1085 heap->cached_chunks_count++;
1086 chunk->next = heap->cached_chunks;
1087 heap->cached_chunks = chunk;
1090 heap->real_size -= ZEND_MM_CHUNK_SIZE;
1092 if (!heap->cached_chunks) {
1093 if (heap->chunks_count != heap->last_chunks_delete_boundary) {
1094 heap->last_chunks_delete_boundary = heap->chunks_count;
1095 heap->last_chunks_delete_count = 0;
1097 heap->last_chunks_delete_count++;
1100 if (!heap->cached_chunks || chunk->num > heap->cached_chunks->num) {
1101 zend_mm_chunk_free(heap, chunk, ZEND_MM_CHUNK_SIZE);
1104 chunk->next = heap->cached_chunks->next;
1105 zend_mm_chunk_free(heap, heap->cached_chunks, ZEND_MM_CHUNK_SIZE);
1106 heap->cached_chunks = chunk;
1111 static zend_always_inline void zend_mm_free_pages_ex(zend_mm_heap *heap, zend_mm_chunk *chunk, uint… argument
1121 zend_mm_delete_chunk(heap, chunk);
1125 static void zend_mm_free_pages(zend_mm_heap *heap, zend_mm_chunk *chunk, int page_num, int pages_co… argument
1127 zend_mm_free_pages_ex(heap, chunk, page_num, pages_count, 1);
1130 static zend_always_inline void zend_mm_free_large(zend_mm_heap *heap, zend_mm_chunk *chunk, int pag… argument
1133 heap->size -= pages_count * ZEND_MM_PAGE_SIZE;
1135 zend_mm_free_pages(heap, chunk, page_num, pages_count);
1204 static zend_never_inline void *zend_mm_alloc_small_slow(zend_mm_heap *heap, uint32_t bin_num ZEND_F… argument
1212 …bin = (zend_mm_bin*)zend_mm_alloc_pages(heap, bin_pages[bin_num], bin_data_size[bin_num] ZEND_FILE…
1214 …bin = (zend_mm_bin*)zend_mm_alloc_pages(heap, bin_pages[bin_num] ZEND_FILE_LINE_RELAY_CC ZEND_FILE…
1235 heap->free_slot[bin_num] = p = (zend_mm_free_slot*)((char*)bin + bin_data_size[bin_num]);
1260 static zend_always_inline void *zend_mm_alloc_small(zend_mm_heap *heap, size_t size, int bin_num ZE… argument
1264 size_t size = heap->size + bin_data_size[bin_num];
1265 size_t peak = MAX(heap->peak, size);
1266 heap->size = size;
1267 heap->peak = peak;
1271 if (EXPECTED(heap->free_slot[bin_num] != NULL)) {
1272 zend_mm_free_slot *p = heap->free_slot[bin_num];
1273 heap->free_slot[bin_num] = p->next_free_slot;
1276 …return zend_mm_alloc_small_slow(heap, bin_num ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC…
1280 static zend_always_inline void zend_mm_free_small(zend_mm_heap *heap, void *ptr, int bin_num) argument
1285 heap->size -= bin_data_size[bin_num];
1296 p->next_free_slot = heap->free_slot[bin_num];
1297 heap->free_slot[bin_num] = p;
1305 static zend_always_inline zend_mm_debug_info *zend_mm_get_debug_info(zend_mm_heap *heap, void *ptr) argument
1316 ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
1328 static zend_always_inline void *zend_mm_alloc_heap(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D… argument
1344 …ptr = zend_mm_alloc_small(heap, size, ZEND_MM_SMALL_SIZE_TO_BIN(size) ZEND_FILE_LINE_RELAY_CC ZEND…
1346 dbg = zend_mm_get_debug_info(heap, ptr);
1355 ptr = zend_mm_alloc_large(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1357 dbg = zend_mm_get_debug_info(heap, ptr);
1369 return zend_mm_alloc_huge(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1373 static zend_always_inline void zend_mm_free_heap(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZE… argument
1379 zend_mm_free_huge(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1386 ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
1388 zend_mm_free_small(heap, ptr, ZEND_MM_SRUN_BIN_NUM(info));
1393 zend_mm_free_large(heap, chunk, page_num, pages_count);
1398 static size_t zend_mm_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) argument
1403 …return zend_mm_get_huge_block_size(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1407 zend_mm_debug_info *dbg = zend_mm_get_debug_info(heap, ptr);
1416 ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
1426 static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, size_t copy_size ZEND… argument
1440 return zend_mm_alloc_heap(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1442 …old_size = zend_mm_get_huge_block_size(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY…
1462 …zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LI…
1464 …zend_mm_change_huge_block_size(heap, ptr, new_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_REL…
1469 if (zend_mm_chunk_truncate(heap, ptr, old_size, new_size)) {
1471 heap->real_size -= old_size - new_size;
1474 heap->size -= old_size - new_size;
1477 …zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LI…
1479 …zend_mm_change_huge_block_size(heap, ptr, new_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_REL…
1485 if (UNEXPECTED(heap->real_size + (new_size - old_size) > heap->limit)) {
1486 if (zend_mm_gc(heap) && heap->real_size + (new_size - old_size) <= heap->limit) {
1488 } else if (heap->overflow == 0) {
1490 …zend_mm_safe_error(heap, "Allowed memory size of %zu bytes exhausted at %s:%d (tried to allocate %…
1492 …zend_mm_safe_error(heap, "Allowed memory size of %zu bytes exhausted (tried to allocate %zu bytes)…
1499 if (zend_mm_chunk_extend(heap, ptr, old_size, new_size)) {
1501 heap->real_size += new_size - old_size;
1504 heap->real_peak = MAX(heap->real_peak, heap->real_size);
1505 heap->size += new_size - old_size;
1506 heap->peak = MAX(heap->peak, heap->size);
1509 …zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LI…
1511 …zend_mm_change_huge_block_size(heap, ptr, new_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_REL…
1527 ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
1535 dbg = zend_mm_get_debug_info(heap, ptr);
1552 dbg = zend_mm_get_debug_info(heap, ptr);
1566 heap->size -= rest_pages_count * ZEND_MM_PAGE_SIZE;
1572 dbg = zend_mm_get_debug_info(heap, ptr);
1589 size_t size = heap->size + (new_size - old_size);
1590 size_t peak = MAX(heap->peak, size);
1591 heap->size = size;
1592 heap->peak = peak;
1599 dbg = zend_mm_get_debug_info(heap, ptr);
1619 size_t orig_peak = heap->peak;
1620 size_t orig_real_peak = heap->real_peak;
1622 ret = zend_mm_alloc_heap(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1624 zend_mm_free_heap(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1626 heap->peak = MAX(orig_peak, heap->size);
1627 heap->real_peak = MAX(orig_real_peak, heap->real_size);
1638 static void zend_mm_add_huge_block(zend_mm_heap *heap, void *ptr, size_t size, size_t dbg_size ZEND… argument
1640 static void zend_mm_add_huge_block(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC ZEN…
1643 …zend_mm_huge_list *list = (zend_mm_huge_list*)zend_mm_alloc_heap(heap, sizeof(zend_mm_huge_list) Z…
1646 list->next = heap->huge_list;
1654 heap->huge_list = list;
1657 static size_t zend_mm_del_huge_block(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE… argument
1660 zend_mm_huge_list *list = heap->huge_list;
1668 heap->huge_list = list->next;
1671 zend_mm_free_heap(heap, list ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1681 static size_t zend_mm_get_huge_block_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE… argument
1683 zend_mm_huge_list *list = heap->huge_list;
1695 static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t size, size_t dbg_s… argument
1697 static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LIN…
1700 zend_mm_huge_list *list = heap->huge_list;
1717 static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_OR… argument
1731 if (UNEXPECTED(heap->real_size + new_size > heap->limit)) {
1732 if (zend_mm_gc(heap) && heap->real_size + new_size <= heap->limit) {
1734 } else if (heap->overflow == 0) {
1736 …zend_mm_safe_error(heap, "Allowed memory size of %zu bytes exhausted at %s:%d (tried to allocate %…
1738 …zend_mm_safe_error(heap, "Allowed memory size of %zu bytes exhausted (tried to allocate %zu bytes)…
1744 ptr = zend_mm_chunk_alloc(heap, new_size, ZEND_MM_CHUNK_SIZE);
1747 if (zend_mm_gc(heap) &&
1748 (ptr = zend_mm_chunk_alloc(heap, new_size, ZEND_MM_CHUNK_SIZE)) != NULL) {
1752 zend_mm_safe_error(heap, "Out of memory");
1754 …zend_mm_safe_error(heap, "Out of memory (allocated %zu) at %s:%d (tried to allocate %zu bytes)", h…
1756 …zend_mm_safe_error(heap, "Out of memory (allocated %zu) (tried to allocate %zu bytes)", heap->real…
1762 …zend_mm_add_huge_block(heap, ptr, new_size, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY…
1764 zend_mm_add_huge_block(heap, ptr, new_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1768 size_t size = heap->real_size + new_size;
1769 size_t peak = MAX(heap->real_peak, size);
1770 heap->real_size = size;
1771 heap->real_peak = peak;
1774 size_t size = heap->size + new_size;
1775 size_t peak = MAX(heap->peak, size);
1776 heap->size = size;
1777 heap->peak = peak;
1780 heap->real_size += new_size;
1785 static void zend_mm_free_huge(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_D… argument
1790 size = zend_mm_del_huge_block(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1791 zend_mm_chunk_free(heap, ptr, size);
1793 heap->real_size -= size;
1796 heap->size -= size;
1807 zend_mm_heap *heap; local
1819 heap = &chunk->heap_slot;
1820 chunk->heap = heap;
1828 heap->main_chunk = chunk;
1829 heap->cached_chunks = NULL;
1830 heap->chunks_count = 1;
1831 heap->peak_chunks_count = 1;
1832 heap->cached_chunks_count = 0;
1833 heap->avg_chunks_count = 1.0;
1834 heap->last_chunks_delete_boundary = 0;
1835 heap->last_chunks_delete_count = 0;
1837 heap->real_size = ZEND_MM_CHUNK_SIZE;
1840 heap->real_peak = ZEND_MM_CHUNK_SIZE;
1841 heap->size = 0;
1842 heap->peak = 0;
1845 heap->limit = ((size_t)Z_L(-1) >> (size_t)Z_L(1));
1846 heap->overflow = 0;
1849 heap->use_custom_heap = ZEND_MM_CUSTOM_HEAP_NONE;
1852 heap->storage = NULL;
1854 heap->huge_list = NULL;
1855 return heap;
1858 ZEND_API size_t zend_mm_gc(zend_mm_heap *heap) argument
1870 if (heap->use_custom_heap) {
1877 p = heap->free_slot[i];
1880 ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
1905 q = &heap->free_slot[i];
1909 ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
1933 chunk = heap->main_chunk;
1945 zend_mm_free_pages_ex(heap, chunk, i, pages_count, 0);
1962 zend_mm_delete_chunk(heap, chunk);
1967 } while (chunk != heap->main_chunk);
2004 static zend_long zend_mm_find_leaks(zend_mm_heap *heap, zend_mm_chunk *p, uint32_t i, zend_leak_inf… argument
2030 } while (p != heap->main_chunk);
2034 static zend_long zend_mm_find_leaks_huge(zend_mm_heap *heap, zend_mm_huge_list *list) argument
2043 zend_mm_chunk_free(heap, p->ptr, p->size);
2044 zend_mm_free_heap(heap, p, NULL, 0, NULL, 0);
2055 static void zend_mm_check_leaks(zend_mm_heap *heap) argument
2065 list = heap->huge_list;
2078 repeated = zend_mm_find_leaks_huge(heap, list);
2084 heap->huge_list = list = list->next;
2085 zend_mm_chunk_free(heap, q->ptr, q->size);
2086 zend_mm_free_heap(heap, q, NULL, 0, NULL, 0);
2090 p = heap->main_chunk;
2117 zend_mm_find_leaks(heap, p, i + bin_pages[bin_num], &leak);
2143 repeated = zend_mm_find_leaks(heap, p, i + pages_count, &leak);
2155 } while (p != heap->main_chunk);
2162 void zend_mm_shutdown(zend_mm_heap *heap, int full, int silent) argument
2168 if (heap->use_custom_heap) {
2170 if (ZEND_DEBUG && heap->use_custom_heap == ZEND_MM_CUSTOM_HEAP_DEBUG) {
2171 heap->custom_heap.debug._free(heap ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC);
2173 heap->custom_heap.std._free(heap);
2182 zend_mm_check_leaks(heap);
2187 list = heap->huge_list;
2188 heap->huge_list = NULL;
2192 zend_mm_chunk_free(heap, q->ptr, q->size);
2196 p = heap->main_chunk->next;
2197 while (p != heap->main_chunk) {
2199 p->next = heap->cached_chunks;
2200 heap->cached_chunks = p;
2202 heap->chunks_count--;
2203 heap->cached_chunks_count++;
2208 while (heap->cached_chunks) {
2209 p = heap->cached_chunks;
2210 heap->cached_chunks = p->next;
2211 zend_mm_chunk_free(heap, p, ZEND_MM_CHUNK_SIZE);
2214 zend_mm_chunk_free(heap, heap->main_chunk, ZEND_MM_CHUNK_SIZE);
2219 heap->avg_chunks_count = (heap->avg_chunks_count + (double)heap->peak_chunks_count) / 2.0;
2220 while ((double)heap->cached_chunks_count + 0.9 > heap->avg_chunks_count &&
2221 heap->cached_chunks) {
2222 p = heap->cached_chunks;
2223 heap->cached_chunks = p->next;
2224 zend_mm_chunk_free(heap, p, ZEND_MM_CHUNK_SIZE);
2225 heap->cached_chunks_count--;
2228 p = heap->cached_chunks;
2237 old_heap = *heap;
2238 p = heap->main_chunk;
2240 *heap = old_heap;
2241 memset(heap->free_slot, 0, sizeof(heap->free_slot));
2242 heap->main_chunk = p;
2243 p->heap = &p->heap_slot;
2250 heap->chunks_count = 1;
2251 heap->peak_chunks_count = 1;
2252 heap->last_chunks_delete_boundary = 0;
2253 heap->last_chunks_delete_count = 0;
2255 heap->real_size = ZEND_MM_CHUNK_SIZE;
2258 heap->real_peak = ZEND_MM_CHUNK_SIZE;
2259 heap->size = heap->peak = 0;
2268 ZEND_API void* ZEND_FASTCALL _zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_… argument
2270 return zend_mm_alloc_heap(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
2273 ZEND_API void ZEND_FASTCALL _zend_mm_free(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE… argument
2275 zend_mm_free_heap(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
2278 void* ZEND_FASTCALL _zend_mm_realloc(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC Z… argument
2280 …return zend_mm_realloc_heap(heap, ptr, size, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELA…
2283 void* ZEND_FASTCALL _zend_mm_realloc2(zend_mm_heap *heap, void *ptr, size_t size, size_t copy_size … argument
2285 …return zend_mm_realloc_heap(heap, ptr, size, copy_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG…
2288 ZEND_API size_t ZEND_FASTCALL _zend_mm_block_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC Z… argument
2290 return zend_mm_size(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
2376 ZEND_MM_CHECK(chunk->heap == AG(mm_heap), "zend_mm_heap corrupted"); \
2388 ZEND_MM_CHECK(chunk->heap == AG(mm_heap), "zend_mm_heap corrupted"); \
2406 …ZEND_MM_CHECK(chunk->heap == AG(mm_heap) && ZEND_MM_ALIGNED_OFFSET(page_offset, ZEND_MM_PAGE_SIZE)…
2681 ZEND_API void zend_mm_set_custom_handlers(zend_mm_heap *heap, argument
2687 zend_mm_heap *_heap = (zend_mm_heap*)heap;
2696 ZEND_API void zend_mm_get_custom_handlers(zend_mm_heap *heap, argument
2702 zend_mm_heap *_heap = (zend_mm_heap*)heap;
2704 if (heap->use_custom_heap) {
2721 ZEND_API void zend_mm_set_custom_debug_handlers(zend_mm_heap *heap, argument
2727 zend_mm_heap *_heap = (zend_mm_heap*)heap;
2737 ZEND_API zend_mm_storage *zend_mm_get_storage(zend_mm_heap *heap) argument
2740 return heap->storage;
2756 zend_mm_heap *heap; local
2771 heap = &chunk->heap_slot;
2772 chunk->heap = heap;
2780 heap->main_chunk = chunk;
2781 heap->cached_chunks = NULL;
2782 heap->chunks_count = 1;
2783 heap->peak_chunks_count = 1;
2784 heap->cached_chunks_count = 0;
2785 heap->avg_chunks_count = 1.0;
2786 heap->last_chunks_delete_boundary = 0;
2787 heap->last_chunks_delete_count = 0;
2789 heap->real_size = ZEND_MM_CHUNK_SIZE;
2792 heap->real_peak = ZEND_MM_CHUNK_SIZE;
2793 heap->size = 0;
2794 heap->peak = 0;
2797 heap->limit = (Z_L(-1) >> Z_L(1));
2798 heap->overflow = 0;
2801 heap->use_custom_heap = 0;
2803 heap->storage = &tmp_storage;
2804 heap->huge_list = NULL;
2805 memset(heap->free_slot, 0, sizeof(heap->free_slot));
2806 …storage = _zend_mm_alloc(heap, sizeof(zend_mm_storage) + data_size ZEND_FILE_LINE_CC ZEND_FILE_LIN…
2823 heap->storage = storage;
2824 return heap;