Lines Matching refs:alignment
148 #define ZEND_MM_ALIGNED_OFFSET(size, alignment) \ argument
149 (((size_t)(size)) & ((alignment) - 1))
150 #define ZEND_MM_ALIGNED_BASE(size, alignment) \ argument
151 (((size_t)(size)) & ~((alignment) - 1))
152 #define ZEND_MM_SIZE_TO_NUM(size, alignment) \ argument
153 (((size_t)(size) + ((alignment) - 1)) / (alignment))
753 static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment) argument
759 } else if (ZEND_MM_ALIGNED_OFFSET(ptr, alignment) == 0) {
769 ptr = zend_mm_mmap(size + alignment - REAL_PAGE_SIZE);
771 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
772 zend_mm_munmap(ptr, size + alignment - REAL_PAGE_SIZE);
773 ptr = zend_mm_mmap_fixed((void*)((char*)ptr + (alignment - offset)), size);
774 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
781 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
783 offset = alignment - offset;
786 alignment -= offset;
788 if (alignment > REAL_PAGE_SIZE) {
789 zend_mm_munmap((char*)ptr + size, alignment - REAL_PAGE_SIZE);
799 static void *zend_mm_chunk_alloc(zend_mm_heap *heap, size_t size, size_t alignment) argument
803 void *ptr = heap->storage->handlers.chunk_alloc(heap->storage, size, alignment);
804 …ZEND_ASSERT(((zend_uintptr_t)((char*)ptr + (alignment-1)) & (alignment-1)) == (zend_uintptr_t)ptr);
808 return zend_mm_chunk_alloc_int(size, alignment);