Lines Matching refs:ptr

309 	void              *ptr;  member
427 …void *ptr = mmap(addr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON /*| MAP_POPULATE | MAP… in zend_mm_mmap_fixed()
429 if (ptr == MAP_FAILED) { in zend_mm_mmap_fixed()
434 } else if (ptr != addr) { in zend_mm_mmap_fixed()
435 if (munmap(ptr, size) != 0) { in zend_mm_mmap_fixed()
442 return ptr; in zend_mm_mmap_fixed()
449 void *ptr = VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); in zend_mm_mmap() local
451 if (ptr == NULL) { in zend_mm_mmap()
457 return ptr; in zend_mm_mmap()
459 void *ptr; in zend_mm_mmap()
463 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_HUGETLB, -1, 0); in zend_mm_mmap()
464 if (ptr != MAP_FAILED) { in zend_mm_mmap()
465 return ptr; in zend_mm_mmap()
470 ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); in zend_mm_mmap()
472 if (ptr == MAP_FAILED) { in zend_mm_mmap()
478 return ptr; in zend_mm_mmap()
707 void *ptr = zend_mm_mmap(size); local
709 if (ptr == NULL) {
711 } else if (ZEND_MM_ALIGNED_OFFSET(ptr, alignment) == 0) {
714 madvise(ptr, size, MADV_HUGEPAGE);
717 return ptr;
722 zend_mm_munmap(ptr, size);
723 ptr = zend_mm_mmap(size + alignment - REAL_PAGE_SIZE);
725 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
726 zend_mm_munmap(ptr, size + alignment - REAL_PAGE_SIZE);
727 ptr = zend_mm_mmap_fixed((void*)((char*)ptr + (alignment - offset)), size);
728 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
730 zend_mm_munmap(ptr, size);
733 return ptr;
735 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
738 zend_mm_munmap(ptr, offset);
739 ptr = (char*)ptr + offset;
743 zend_mm_munmap((char*)ptr + size, alignment - REAL_PAGE_SIZE);
747 madvise(ptr, size, MADV_HUGEPAGE);
751 return ptr;
759 void *ptr = heap->storage->handlers.chunk_alloc(heap->storage, size, alignment); local
760 …ZEND_ASSERT(((zend_uintptr_t)((char*)ptr + (alignment-1)) & (alignment-1)) == (zend_uintptr_t)ptr);
761 return ptr;
836 static size_t zend_mm_get_huge_block_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE…
838 static void zend_mm_free_huge(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_D…
841 static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t size, size_t dbg_s…
843 static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LIN…
1063 …void *ptr = zend_mm_alloc_pages(heap, pages_count, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORI… local
1065 …void *ptr = zend_mm_alloc_pages(heap, pages_count ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELA… local
1075 return ptr;
1282 static zend_always_inline void zend_mm_free_small(zend_mm_heap *heap, void *ptr, int bin_num) argument
1292 …zend_mm_debug_info *dbg = (zend_mm_debug_info*)((char*)ptr + bin_data_size[bin_num] - ZEND_MM_ALIG…
1297 p = (zend_mm_free_slot*)ptr;
1307 static zend_always_inline zend_mm_debug_info *zend_mm_get_debug_info(zend_mm_heap *heap, void *ptr) argument
1309 size_t page_offset = ZEND_MM_ALIGNED_OFFSET(ptr, ZEND_MM_CHUNK_SIZE);
1315 chunk = (zend_mm_chunk*)ZEND_MM_ALIGNED_BASE(ptr, ZEND_MM_CHUNK_SIZE);
1321 …return (zend_mm_debug_info*)((char*)ptr + bin_data_size[bin_num] - ZEND_MM_ALIGNED_SIZE(sizeof(zen…
1325 …return (zend_mm_debug_info*)((char*)ptr + ZEND_MM_PAGE_SIZE * pages_count - ZEND_MM_ALIGNED_SIZE(s…
1332 void *ptr; local
1346ptr = zend_mm_alloc_small(heap, size, ZEND_MM_SMALL_SIZE_TO_BIN(size) ZEND_FILE_LINE_RELAY_CC ZEND…
1348 dbg = zend_mm_get_debug_info(heap, ptr);
1355 return ptr;
1357 ptr = zend_mm_alloc_large(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1359 dbg = zend_mm_get_debug_info(heap, ptr);
1366 return ptr;
1375 static zend_always_inline void zend_mm_free_heap(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZE…
1377 size_t page_offset = ZEND_MM_ALIGNED_OFFSET(ptr, ZEND_MM_CHUNK_SIZE);
1380 if (ptr != NULL) {
1381 zend_mm_free_huge(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1384 zend_mm_chunk *chunk = (zend_mm_chunk*)ZEND_MM_ALIGNED_BASE(ptr, ZEND_MM_CHUNK_SIZE);
1390 zend_mm_free_small(heap, ptr, ZEND_MM_SRUN_BIN_NUM(info));
1400 static size_t zend_mm_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
1402 size_t page_offset = ZEND_MM_ALIGNED_OFFSET(ptr, ZEND_MM_CHUNK_SIZE);
1405 …return zend_mm_get_huge_block_size(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1409 zend_mm_debug_info *dbg = zend_mm_get_debug_info(heap, ptr);
1415 chunk = (zend_mm_chunk*)ZEND_MM_ALIGNED_BASE(ptr, ZEND_MM_CHUNK_SIZE);
1428 static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, size_t copy_size ZEND… argument
1439 page_offset = ZEND_MM_ALIGNED_OFFSET(ptr, ZEND_MM_CHUNK_SIZE);
1441 if (UNEXPECTED(ptr == NULL)) {
1444 …old_size = zend_mm_get_huge_block_size(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY…
1464 …zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LI…
1466 …zend_mm_change_huge_block_size(heap, ptr, new_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_REL…
1468 return ptr;
1471 if (zend_mm_chunk_truncate(heap, ptr, old_size, new_size)) {
1479 …zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LI…
1481 …zend_mm_change_huge_block_size(heap, ptr, new_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_REL…
1483 return ptr;
1501 if (zend_mm_chunk_extend(heap, ptr, old_size, new_size)) {
1511 …zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LI…
1513 …zend_mm_change_huge_block_size(heap, ptr, new_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_REL…
1515 return ptr;
1520 zend_mm_chunk *chunk = (zend_mm_chunk*)ZEND_MM_ALIGNED_BASE(ptr, ZEND_MM_CHUNK_SIZE);
1537 dbg = zend_mm_get_debug_info(heap, ptr);
1544 return ptr;
1554 dbg = zend_mm_get_debug_info(heap, ptr);
1561 return ptr;
1574 dbg = zend_mm_get_debug_info(heap, ptr);
1581 return ptr;
1601 dbg = zend_mm_get_debug_info(heap, ptr);
1608 return ptr;
1625 memcpy(ret, ptr, MIN(old_size, copy_size));
1626 zend_mm_free_heap(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1640 static void zend_mm_add_huge_block(zend_mm_heap *heap, void *ptr, size_t size, size_t dbg_size ZEND… argument
1642 static void zend_mm_add_huge_block(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC ZEN…
1646 list->ptr = ptr;
1659 static size_t zend_mm_del_huge_block(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE…
1664 if (list->ptr == ptr) {
1683 static size_t zend_mm_get_huge_block_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE…
1687 if (list->ptr == ptr) {
1697 static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t size, size_t dbg_s… argument
1699 static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LIN…
1704 if (list->ptr == ptr) {
1731 void *ptr; local
1751 ptr = zend_mm_chunk_alloc(heap, new_size, ZEND_MM_CHUNK_SIZE);
1752 if (UNEXPECTED(ptr == NULL)) {
1755 (ptr = zend_mm_chunk_alloc(heap, new_size, ZEND_MM_CHUNK_SIZE)) != NULL) {
1769 …zend_mm_add_huge_block(heap, ptr, new_size, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY…
1771 zend_mm_add_huge_block(heap, ptr, new_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1789 return ptr;
1792 static void zend_mm_free_huge(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_D…
1796 ZEND_MM_CHECK(ZEND_MM_ALIGNED_OFFSET(ptr, ZEND_MM_CHUNK_SIZE) == 0, "zend_mm_heap corrupted");
1797 size = zend_mm_del_huge_block(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
1798 zend_mm_chunk_free(heap, ptr, size);
2050 zend_mm_chunk_free(heap, p->ptr, p->size);
2076 leak.addr = list->ptr;
2092 zend_mm_chunk_free(heap, q->ptr, q->size);
2199 zend_mm_chunk_free(heap, q->ptr, q->size);
2280 ZEND_API void ZEND_FASTCALL _zend_mm_free(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE…
2282 zend_mm_free_heap(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
2285 void* ZEND_FASTCALL _zend_mm_realloc(zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC Z… argument
2287 …return zend_mm_realloc_heap(heap, ptr, size, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELA…
2290 void* ZEND_FASTCALL _zend_mm_realloc2(zend_mm_heap *heap, void *ptr, size_t size, size_t copy_size … argument
2292 …return zend_mm_realloc_heap(heap, ptr, size, copy_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG…
2295 ZEND_API size_t ZEND_FASTCALL _zend_mm_block_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC Z…
2297 return zend_mm_size(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
2338 # define ZEND_MM_CUSTOM_DEALLOCATOR(ptr) do { \ argument
2341 … AG(mm_heap)->custom_heap.debug._free(ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); \
2343 AG(mm_heap)->custom_heap.std._free(ptr); \
2350 # define ZEND_MM_CUSTOM_DEALLOCATOR(ptr) argument
2377 ZEND_API void ZEND_FASTCALL _efree_ ## _size(void *ptr) { \
2378 ZEND_MM_CUSTOM_DEALLOCATOR(ptr); \
2380 size_t page_offset = ZEND_MM_ALIGNED_OFFSET(ptr, ZEND_MM_CHUNK_SIZE); \
2381 zend_mm_chunk *chunk = (zend_mm_chunk*)ZEND_MM_ALIGNED_BASE(ptr, ZEND_MM_CHUNK_SIZE); \
2386 zend_mm_free_small(AG(mm_heap), ptr, _num); \
2391 ZEND_API void ZEND_FASTCALL _efree_ ## _size(void *ptr) { \
2392 ZEND_MM_CUSTOM_DEALLOCATOR(ptr); \
2394 zend_mm_chunk *chunk = (zend_mm_chunk*)ZEND_MM_ALIGNED_BASE(ptr, ZEND_MM_CHUNK_SIZE); \
2396 zend_mm_free_small(AG(mm_heap), ptr, _num); \
2403 ZEND_API void ZEND_FASTCALL _efree_large(void *ptr, size_t size)
2406 ZEND_MM_CUSTOM_DEALLOCATOR(ptr);
2408 size_t page_offset = ZEND_MM_ALIGNED_OFFSET(ptr, ZEND_MM_CHUNK_SIZE);
2409 zend_mm_chunk *chunk = (zend_mm_chunk*)ZEND_MM_ALIGNED_BASE(ptr, ZEND_MM_CHUNK_SIZE);
2420 ZEND_API void ZEND_FASTCALL _efree_huge(void *ptr, size_t size) argument
2423 ZEND_MM_CUSTOM_DEALLOCATOR(ptr);
2424 zend_mm_free_huge(AG(mm_heap), ptr);
2443 ZEND_API void ZEND_FASTCALL _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
2449 AG(mm_heap)->custom_heap.debug._free(ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
2451 AG(mm_heap)->custom_heap.std._free(ptr);
2456 zend_mm_free_heap(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
2459 ZEND_API void* ZEND_FASTCALL _erealloc(void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG… argument
2464 …return AG(mm_heap)->custom_heap.debug._realloc(ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_OR…
2466 return AG(mm_heap)->custom_heap.std._realloc(ptr, size);
2469 …return zend_mm_realloc_heap(AG(mm_heap), ptr, size, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_OR…
2472 ZEND_API void* ZEND_FASTCALL _erealloc2(void *ptr, size_t size, size_t copy_size ZEND_FILE_LINE_DC … argument
2477 …return AG(mm_heap)->custom_heap.debug._realloc(ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_OR…
2479 return AG(mm_heap)->custom_heap.std._realloc(ptr, size);
2482 …return zend_mm_realloc_heap(AG(mm_heap), ptr, size, copy_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LI…
2485 ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_…
2490 return zend_mm_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
2503 ZEND_API void* ZEND_FASTCALL _safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEN… argument
2505 return erealloc_rel(ptr, zend_safe_address_guarded(nmemb, size, offset));
2508 ZEND_API void* ZEND_FASTCALL _safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset) argument
2510 return perealloc(ptr, zend_safe_address_guarded(nmemb, size, offset), 1);