Lines Matching refs:alignment
147 #define ZEND_MM_ALIGNED_OFFSET(size, alignment) \ argument
148 (((size_t)(size)) & ((alignment) - 1))
149 #define ZEND_MM_ALIGNED_BASE(size, alignment) \ argument
150 (((size_t)(size)) & ~((alignment) - 1))
151 #define ZEND_MM_SIZE_TO_NUM(size, alignment) \ argument
152 (((size_t)(size) + ((alignment) - 1)) / (alignment))
707 static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment) argument
713 } else if (ZEND_MM_ALIGNED_OFFSET(ptr, alignment) == 0) {
725 ptr = zend_mm_mmap(size + alignment - REAL_PAGE_SIZE);
727 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
728 zend_mm_munmap(ptr, size + alignment - REAL_PAGE_SIZE);
729 ptr = zend_mm_mmap_fixed((void*)((char*)ptr + (alignment - offset)), size);
730 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
737 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
739 offset = alignment - offset;
742 alignment -= offset;
744 if (alignment > REAL_PAGE_SIZE) {
745 zend_mm_munmap((char*)ptr + size, alignment - REAL_PAGE_SIZE);
757 static void *zend_mm_chunk_alloc(zend_mm_heap *heap, size_t size, size_t alignment) argument
761 void *ptr = heap->storage->handlers.chunk_alloc(heap->storage, size, alignment);
762 …ZEND_ASSERT(((zend_uintptr_t)((char*)ptr + (alignment-1)) & (alignment-1)) == (zend_uintptr_t)ptr);
766 return zend_mm_chunk_alloc_int(size, alignment);
1795 size_t alignment = MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE); local
1797 size_t alignment = REAL_PAGE_SIZE;
1799 size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, alignment);
1803 …r_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu + %zu)", size, alignment);