Lines Matching full:alignment

203  * n: alignment
212 /* Use MALLOCX_ALIGN_GET() if alignment may not be specified in flags. */
229 * Minimum allocation alignment is 2^LG_QUANTUM bytes (ignoring tiny size
282 # error "Unknown minimum alignment for architecture; specify via "
339 #define ALIGNMENT_ADDR2BASE(a, alignment) \ argument
340 ((void *)((uintptr_t)(a) & ((~(alignment)) + 1)))
343 #define ALIGNMENT_ADDR2OFFSET(a, alignment) \ argument
344 ((size_t)((uintptr_t)(a) & (alignment - 1)))
346 /* Return the smallest alignment multiple that is >= s. */
347 #define ALIGNMENT_CEILING(s, alignment) \ argument
348 (((s) + (alignment - 1)) & ((~(alignment)) + 1))
575 size_t sa2u(size_t size, size_t alignment);
810 * specified size and alignment.
813 sa2u(size_t size, size_t alignment) in sa2u() argument
817 assert(alignment != 0 && ((alignment - 1) & alignment) == 0); in sa2u()
820 if (size <= SMALL_MAXCLASS && alignment < PAGE) { in sa2u()
822 * Round size up to the nearest multiple of alignment. in sa2u()
829 * Size | Base 2 | Minimum alignment in sa2u()
835 usize = s2u(ALIGNMENT_CEILING(size, alignment)); in sa2u()
841 if (likely(size <= large_maxclass) && likely(alignment < chunksize)) { in sa2u()
843 * We can't achieve subpage alignment, so round up alignment in sa2u()
846 alignment = PAGE_CEILING(alignment); in sa2u()
853 * would need to allocate in order to guarantee the alignment. in sa2u()
855 if (usize + large_pad + alignment - PAGE <= arena_maxrun) in sa2u()
861 if (unlikely(alignment > HUGE_MAXCLASS)) in sa2u()
865 * We can't achieve subchunk alignment, so round up alignment to the in sa2u()
868 alignment = CHUNK_CEILING(alignment); in sa2u()
883 * order to guarantee the alignment. in sa2u()
885 if (usize + alignment - PAGE < usize) { in sa2u()
997 void *ipallocztm(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero,
999 void *ipalloct(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero,
1001 void *ipalloc(tsd_t *tsd, size_t usize, size_t alignment, bool zero);
1014 size_t extra, size_t alignment, bool zero, tcache_t *tcache,
1017 size_t alignment, bool zero, tcache_t *tcache, arena_t *arena);
1019 size_t alignment, bool zero);
1021 size_t extra, size_t alignment, bool zero);
1078 ipallocztm(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero, in ipallocztm() argument
1084 assert(usize == sa2u(usize, alignment)); in ipallocztm()
1088 ret = arena_palloc(tsdn, arena, usize, alignment, zero, tcache); in ipallocztm()
1089 assert(ALIGNMENT_ADDR2BASE(ret, alignment) == ret); in ipallocztm()
1098 ipalloct(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero, in ipalloct() argument
1102 return (ipallocztm(tsdn, usize, alignment, zero, tcache, false, arena)); in ipalloct()
1106 ipalloc(tsd_t *tsd, size_t usize, size_t alignment, bool zero) in ipalloc() argument
1109 return (ipallocztm(tsd_tsdn(tsd), usize, alignment, zero, in ipalloc()
1204 size_t extra, size_t alignment, bool zero, tcache_t *tcache, arena_t *arena) in iralloct_realign() argument
1209 usize = sa2u(size + extra, alignment); in iralloct_realign()
1212 p = ipalloct(tsd_tsdn(tsd), usize, alignment, zero, tcache, arena); in iralloct_realign()
1217 usize = sa2u(size, alignment); in iralloct_realign()
1220 p = ipalloct(tsd_tsdn(tsd), usize, alignment, zero, tcache, in iralloct_realign()
1236 iralloct(tsd_t *tsd, void *ptr, size_t oldsize, size_t size, size_t alignment, in iralloct() argument
1243 if (alignment != 0 && ((uintptr_t)ptr & ((uintptr_t)alignment-1)) in iralloct()
1246 * Existing object alignment is inadequate; allocate new space in iralloct()
1249 return (iralloct_realign(tsd, ptr, oldsize, size, 0, alignment, in iralloct()
1253 return (arena_ralloc(tsd, arena, ptr, oldsize, size, alignment, zero, in iralloct()
1258 iralloc(tsd_t *tsd, void *ptr, size_t oldsize, size_t size, size_t alignment, in iralloc() argument
1262 return (iralloct(tsd, ptr, oldsize, size, alignment, zero, in iralloc()
1268 size_t alignment, bool zero) in ixalloc() argument
1274 if (alignment != 0 && ((uintptr_t)ptr & ((uintptr_t)alignment-1)) in ixalloc()
1276 /* Existing object alignment is inadequate. */ in ixalloc()