Lines Matching refs:alignment

153 #define ZEND_MM_ALIGNED_OFFSET(size, alignment) \  argument
154 (((size_t)(size)) & ((alignment) - 1))
155 #define ZEND_MM_ALIGNED_BASE(size, alignment) \ argument
156 (((size_t)(size)) & ~((alignment) - 1))
157 #define ZEND_MM_SIZE_TO_NUM(size, alignment) \ argument
158 (((size_t)(size) + ((alignment) - 1)) / (alignment))
718 static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment) argument
724 } else if (ZEND_MM_ALIGNED_OFFSET(ptr, alignment) == 0) {
734 ptr = zend_mm_mmap(size + alignment - REAL_PAGE_SIZE);
736 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
738 offset = alignment - offset;
740 zend_mm_munmap(ptr, size + alignment - REAL_PAGE_SIZE);
743 ptr = zend_mm_mmap(size + alignment - REAL_PAGE_SIZE);
747 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
749 ptr = (void*)((char*)ptr + alignment - offset);
754 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
756 offset = alignment - offset;
759 alignment -= offset;
761 if (alignment > REAL_PAGE_SIZE) {
762 zend_mm_munmap((char*)ptr + size, alignment - REAL_PAGE_SIZE);
772 static void *zend_mm_chunk_alloc(zend_mm_heap *heap, size_t size, size_t alignment) argument
776 void *ptr = heap->storage->handlers.chunk_alloc(heap->storage, size, alignment);
777 …ZEND_ASSERT(((zend_uintptr_t)((char*)ptr + (alignment-1)) & (alignment-1)) == (zend_uintptr_t)ptr);
781 return zend_mm_chunk_alloc_int(size, alignment);
1815 size_t alignment = MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE); local
1817 size_t alignment = REAL_PAGE_SIZE;
1819 size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, alignment);
1823 …r_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu + %zu)", size, alignment);