Lines Matching full:alignment

197  * n: alignment
206 /* Use MALLOCX_ALIGN_GET() if alignment may not be specified in flags. */
223 * Minimum allocation alignment is 2^LG_QUANTUM bytes (ignoring tiny size
273 # error "Unknown minimum alignment for architecture; specify via "
330 #define ALIGNMENT_ADDR2BASE(a, alignment) \ argument
331 ((void *)((uintptr_t)(a) & (-(alignment))))
334 #define ALIGNMENT_ADDR2OFFSET(a, alignment) \ argument
335 ((size_t)((uintptr_t)(a) & (alignment - 1)))
337 /* Return the smallest alignment multiple that is >= s. */
338 #define ALIGNMENT_CEILING(s, alignment) \ argument
339 (((s) + (alignment - 1)) & (-(alignment)))
544 size_t sa2u(size_t size, size_t alignment);
699 * specified size and alignment.
702 sa2u(size_t size, size_t alignment) argument
706 assert(alignment != 0 && ((alignment - 1) & alignment) == 0);
709 if (size <= SMALL_MAXCLASS && alignment < PAGE) {
711 * Round size up to the nearest multiple of alignment.
718 * Size | Base 2 | Minimum alignment
724 usize = s2u(ALIGNMENT_CEILING(size, alignment));
730 if (likely(size <= large_maxclass) && likely(alignment < chunksize)) {
732 * We can't achieve subpage alignment, so round up alignment
735 alignment = PAGE_CEILING(alignment);
742 * would need to allocate in order to guarantee the alignment.
744 if (usize + large_pad + alignment - PAGE <= arena_maxrun)
750 if (unlikely(alignment > HUGE_MAXCLASS))
754 * We can't achieve subchunk alignment, so round up alignment to the
757 alignment = CHUNK_CEILING(alignment);
772 * order to guarantee the alignment.
774 if (usize + alignment - PAGE < usize) {
875 void *ipallocztm(tsd_t *tsd, size_t usize, size_t alignment, bool zero,
877 void *ipalloct(tsd_t *tsd, size_t usize, size_t alignment, bool zero,
879 void *ipalloc(tsd_t *tsd, size_t usize, size_t alignment, bool zero);
891 size_t extra, size_t alignment, bool zero, tcache_t *tcache,
894 size_t alignment, bool zero, tcache_t *tcache, arena_t *arena);
896 size_t alignment, bool zero);
898 size_t extra, size_t alignment, bool zero);
974 ipallocztm(tsd_t *tsd, size_t usize, size_t alignment, bool zero, argument
980 assert(usize == sa2u(usize, alignment));
982 ret = arena_palloc(tsd, arena, usize, alignment, zero, tcache);
983 assert(ALIGNMENT_ADDR2BASE(ret, alignment) == ret);
992 ipalloct(tsd_t *tsd, size_t usize, size_t alignment, bool zero, argument
996 return (ipallocztm(tsd, usize, alignment, zero, tcache, false, arena));
1000 ipalloc(tsd_t *tsd, size_t usize, size_t alignment, bool zero) argument
1003 return (ipallocztm(tsd, usize, alignment, zero, tcache_get(tsd, true),
1102 size_t extra, size_t alignment, bool zero, tcache_t *tcache, arena_t *arena) argument
1107 usize = sa2u(size + extra, alignment);
1110 p = ipalloct(tsd, usize, alignment, zero, tcache, arena);
1115 usize = sa2u(size, alignment);
1118 p = ipalloct(tsd, usize, alignment, zero, tcache, arena);
1133 iralloct(tsd_t *tsd, void *ptr, size_t oldsize, size_t size, size_t alignment, argument
1140 if (alignment != 0 && ((uintptr_t)ptr & ((uintptr_t)alignment-1))
1143 * Existing object alignment is inadequate; allocate new space
1146 return (iralloct_realign(tsd, ptr, oldsize, size, 0, alignment,
1150 return (arena_ralloc(tsd, arena, ptr, oldsize, size, alignment, zero,
1155 iralloc(tsd_t *tsd, void *ptr, size_t oldsize, size_t size, size_t alignment, argument
1159 return (iralloct(tsd, ptr, oldsize, size, alignment, zero,
1165 size_t alignment, bool zero) argument
1171 if (alignment != 0 && ((uintptr_t)ptr & ((uintptr_t)alignment-1))
1173 /* Existing object alignment is inadequate. */