Lines Matching refs:alignment
151 #define ZEND_MM_ALIGNED_OFFSET(size, alignment) \ argument
152 (((size_t)(size)) & ((alignment) - 1))
153 #define ZEND_MM_ALIGNED_BASE(size, alignment) \ argument
154 (((size_t)(size)) & ~((alignment) - 1))
155 #define ZEND_MM_SIZE_TO_NUM(size, alignment) \ argument
156 (((size_t)(size) + ((alignment) - 1)) / (alignment))
664 static void *zend_mm_chunk_alloc_int(size_t size, size_t alignment) argument
670 } else if (ZEND_MM_ALIGNED_OFFSET(ptr, alignment) == 0) {
682 ptr = zend_mm_mmap(size + alignment - REAL_PAGE_SIZE);
684 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
685 zend_mm_munmap(ptr, size + alignment - REAL_PAGE_SIZE);
686 ptr = zend_mm_mmap_fixed((void*)((char*)ptr + (alignment - offset)), size);
687 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
694 offset = ZEND_MM_ALIGNED_OFFSET(ptr, alignment);
696 offset = alignment - offset;
699 alignment -= offset;
701 if (alignment > REAL_PAGE_SIZE) {
702 zend_mm_munmap((char*)ptr + size, alignment - REAL_PAGE_SIZE);
714 static void *zend_mm_chunk_alloc(zend_mm_heap *heap, size_t size, size_t alignment) argument
718 void *ptr = heap->storage->handlers.chunk_alloc(heap->storage, size, alignment);
719 …ZEND_ASSERT(((zend_uintptr_t)((char*)ptr + (alignment-1)) & (alignment-1)) == (zend_uintptr_t)ptr);
723 return zend_mm_chunk_alloc_int(size, alignment);
1757 size_t alignment = MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE); local
1759 size_t alignment = REAL_PAGE_SIZE;
1761 size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, alignment);
1765 …r_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu + %zu)", size, alignment);