Lines Matching refs:segment
153 static zend_mm_segment* zend_mm_mem_mmap_realloc(zend_mm_storage *storage, zend_mm_segment* segment… in zend_mm_mem_mmap_realloc() argument
159 ret = (zend_mm_segment*)mremap(segment, segment->size, segment, size, MREMAP_MAYMOVE); in zend_mm_mem_mmap_realloc()
161 ret = (zend_mm_segment*)mremap(segment, segment->size, size, MREMAP_MAYMOVE); in zend_mm_mem_mmap_realloc()
167 memcpy(ret, segment, size > segment->size ? segment->size : size); in zend_mm_mem_mmap_realloc()
168 storage->handlers->_free(storage, segment); in zend_mm_mem_mmap_realloc()
176 static void zend_mm_mem_mmap_free(zend_mm_storage *storage, zend_mm_segment* segment) in zend_mm_mem_mmap_free() argument
178 munmap((void*)segment, segment->size); in zend_mm_mem_mmap_free()
269 static void zend_mm_mem_win32_free(zend_mm_storage *storage, zend_mm_segment* segment) in zend_mm_mem_win32_free() argument
271 HeapFree((HANDLE)storage->data, HEAP_NO_SERIALIZE, segment); in zend_mm_mem_win32_free()
274 …segment* zend_mm_mem_win32_realloc(zend_mm_storage *storage, zend_mm_segment* segment, size_t size) in zend_mm_mem_win32_realloc() argument
276 return (zend_mm_segment*) HeapReAlloc((HANDLE)storage->data, HEAP_NO_SERIALIZE, segment, size); in zend_mm_mem_win32_realloc()
915 static void zend_mm_del_segment(zend_mm_heap *heap, zend_mm_segment *segment) in zend_mm_del_segment() argument
919 while (*p != segment) { in zend_mm_del_segment()
922 *p = segment->next_segment; in zend_mm_del_segment()
923 heap->real_size -= segment->size; in zend_mm_del_segment()
924 ZEND_MM_STORAGE_FREE(segment); in zend_mm_del_segment()
1230 static long zend_mm_find_leaks(zend_mm_segment *segment, zend_mm_block *b) in zend_mm_find_leaks() argument
1239 segment = segment->next_segment; in zend_mm_find_leaks()
1240 if (!segment) { in zend_mm_find_leaks()
1243 p = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); in zend_mm_find_leaks()
1248 (char*)q > (char*)segment + segment->size || in zend_mm_find_leaks()
1273 zend_mm_segment *segment = heap->segments_list; in zend_mm_check_leaks() local
1277 if (!segment) { in zend_mm_check_leaks()
1280 p = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); in zend_mm_check_leaks()
1284 (char*)q > (char*)segment + segment->size || in zend_mm_check_leaks()
1304 repeated = zend_mm_find_leaks(segment, p); in zend_mm_check_leaks()
1318 segment = segment->next_segment; in zend_mm_check_leaks()
1319 if (!segment) { in zend_mm_check_leaks()
1322 q = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); in zend_mm_check_leaks()
1557 zend_mm_segment *segment = heap->segments_list; in zend_mm_check_heap() local
1561 if (!segment) { in zend_mm_check_heap()
1564 p = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); in zend_mm_check_heap()
1568 (char*)q > (char*)segment + segment->size || in zend_mm_check_heap()
1586 segment = segment->next_segment; in zend_mm_check_heap()
1587 if (!segment) { in zend_mm_check_heap()
1590 q = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); in zend_mm_check_heap()
1600 zend_mm_segment *segment; in zend_mm_shutdown() local
1674 segment = heap->segments_list; in zend_mm_shutdown()
1676 while (segment) { in zend_mm_shutdown()
1677 prev = segment; in zend_mm_shutdown()
1678 segment = segment->next_segment; in zend_mm_shutdown()
1687 if (segment) { in zend_mm_shutdown()
1690 while (segment->next_segment) { in zend_mm_shutdown()
1691 prev = segment; in zend_mm_shutdown()
1692 segment = segment->next_segment; in zend_mm_shutdown()
1695 heap->segments_list = segment; in zend_mm_shutdown()
1699 prev = segment; in zend_mm_shutdown()
1700 segment = segment->next_segment; in zend_mm_shutdown()
1702 } while (segment); in zend_mm_shutdown()
1883 zend_mm_segment *segment; in _zend_mm_alloc_int() local
1978 segment = (zend_mm_segment *) ZEND_MM_STORAGE_ALLOC(segment_size); in _zend_mm_alloc_int()
1980 if (!segment) { in _zend_mm_alloc_int()
2000 segment->size = segment_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()
2004 best_fit = (zend_mm_free_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); in _zend_mm_alloc_int()
2259 zend_mm_segment *segment; in _zend_mm_realloc_int() local
2292 segment = ZEND_MM_STORAGE_REALLOC(segment_copy, segment_size); in _zend_mm_realloc_int()
2293 if (!segment) { in _zend_mm_realloc_int()
2306 heap->real_size += segment_size - segment->size; in _zend_mm_realloc_int()
2311 segment->size = segment_size; in _zend_mm_realloc_int()
2313 if (segment != segment_copy) { in _zend_mm_realloc_int()
2318 *seg = segment; in _zend_mm_realloc_int()
2319 mm_block = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); in _zend_mm_realloc_int()