Home
last modified time | relevance | path

Searched refs:alignment (Results 1 – 8 of 8) sorted by last modified time

/unit/src/
H A Dnxt_mp.c154 static void *nxt_mp_alloc_large(nxt_mp_t *mp, size_t alignment, size_t size,
431 nxt_mp_align(nxt_mp_t *mp, size_t alignment, size_t size) in nxt_mp_align() argument
437 if (nxt_fast_path(nxt_is_power_of_two(alignment))) { in nxt_mp_align()
443 aligned_size = nxt_max(size, alignment); in nxt_mp_align()
449 p = nxt_mp_alloc_large(mp, alignment, size, 1); in nxt_mp_align()
454 p = nxt_mp_alloc_large(mp, alignment, size, 1); in nxt_mp_align()
462 nxt_debug_alloc("mp %p align(@%uz:%uz): %p", mp, alignment, size, p); in nxt_mp_align()
469 nxt_mp_zalign(nxt_mp_t *mp, size_t alignment, size_t size) in nxt_mp_zalign() argument
473 p = nxt_mp_align(mp, alignment, size); in nxt_mp_zalign()
711 nxt_mp_alloc_large(nxt_mp_t *mp, size_t alignment, size_t size, in nxt_mp_alloc_large() argument
[all …]
H A Dnxt_socket.h81 uint64_t alignment; member
H A Dnxt_mem_zone.c141 size_t alignment, uint32_t pages);
144 uint32_t alignment, uint32_t pages);
449 if (nxt_slow_path((alignment - 1) & alignment) != 0) { in nxt_mem_zone_align()
457 if (alignment > 16) { in nxt_mem_zone_align()
466 size = nxt_max(size, alignment); in nxt_mem_zone_align()
476 alignment, size, slot->size); in nxt_mem_zone_align()
499 alignment, size); in nxt_mem_zone_align()
669 p = nxt_align_ptr(block, alignment); in nxt_mem_zone_alloc_pages()
728 uint32_t alignment, uint32_t pages) in nxt_mem_zone_find_free_block() argument
747 aligned = nxt_align_ptr(block, alignment); in nxt_mem_zone_find_free_block()
[all …]
H A Dnxt_malloc.h17 NXT_EXPORT void *nxt_memalign(size_t alignment, size_t size)
H A Dnxt_mem_zone.h20 NXT_EXPORT void *nxt_mem_zone_align(nxt_mem_zone_t *zone, size_t alignment,
H A Dnxt_malloc.c129 nxt_memalign(size_t alignment, size_t size) in nxt_memalign() argument
134 err = posix_memalign(&p, alignment, size); in nxt_memalign()
138 alignment, size, p); in nxt_memalign()
144 alignment, size, err); in nxt_memalign()
153 nxt_memalign(size_t alignment, size_t size) in nxt_memalign() argument
157 p = memalign(alignment, size); in nxt_memalign()
181 nxt_memalign(size_t alignment, size_t size) in nxt_memalign() argument
187 if (nxt_slow_path((alignment - 1) & alignment) != 0) { in nxt_memalign()
193 if (nxt_slow_path(alignment > 4096)) { in nxt_memalign()
199 aligned_size = nxt_max(size, alignment); in nxt_memalign()
[all …]
H A Dnxt_mp.h79 NXT_EXPORT void *nxt_mp_align(nxt_mp_t *mp, size_t alignment, size_t size)
83 NXT_EXPORT void *nxt_mp_zalign(nxt_mp_t *mp, size_t alignment, size_t size)
/unit/src/test/
H A Dnxt_malloc_test.c16 size_t alignment; member
25 size_t a, s, alignment; in nxt_malloc_run_test() local
30 alignment = (size_t) -1; in nxt_malloc_run_test()
48 alignment = nxt_min(alignment, a); in nxt_malloc_run_test()
63 alignment = 1 << alignment; in nxt_malloc_run_test()
67 "malloc: %uz, %uz, %ui", size, alignment, tight); in nxt_malloc_run_test()
70 while (last->alignment >= alignment) { in nxt_malloc_run_test()
77 last->alignment = alignment; in nxt_malloc_run_test()
119 s[-1].size + 1, s->size, s->alignment, s->tight); in nxt_malloc_test()