Lines Matching refs:size

46     uint8_t              size;  member
95 uint32_t size; member
144 #define nxt_mp_free_junk(p, size) \ argument
145 memset((p), 0x5A, size)
149 static void *nxt_mp_alloc_small(nxt_mp_t *mp, size_t size);
150 static void *nxt_mp_get_small(nxt_mp_t *mp, nxt_queue_t *pages, size_t size);
154 static void *nxt_mp_alloc_large(nxt_mp_t *mp, size_t alignment, size_t size,
390 nxt_mp_alloc(nxt_mp_t *mp, size_t size) in nxt_mp_alloc() argument
396 if (size <= mp->page_size) { in nxt_mp_alloc()
397 p = nxt_mp_alloc_small(mp, size); in nxt_mp_alloc()
400 p = nxt_mp_alloc_large(mp, NXT_MAX_ALIGNMENT, size, 1); in nxt_mp_alloc()
405 p = nxt_mp_alloc_large(mp, NXT_MAX_ALIGNMENT, size, 1); in nxt_mp_alloc()
409 nxt_debug_alloc("mp %p alloc(%uz): %p", mp, size, p); in nxt_mp_alloc()
416 nxt_mp_zalloc(nxt_mp_t *mp, size_t size) in nxt_mp_zalloc() argument
420 p = nxt_mp_alloc(mp, size); in nxt_mp_zalloc()
423 memset(p, 0, size); in nxt_mp_zalloc()
431 nxt_mp_align(nxt_mp_t *mp, size_t alignment, size_t size) in nxt_mp_align() argument
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()
476 memset(p, 0, size); in nxt_mp_zalign()
484 nxt_mp_chunk_pages_index(nxt_mp_t *mp, size_t size) in nxt_mp_chunk_pages_index() argument
490 if (size > 1) { in nxt_mp_chunk_pages_index()
491 n = nxt_lg2(size - 1) + 1 - mp->chunk_size_shift; in nxt_mp_chunk_pages_index()
520 nxt_mp_alloc_small(nxt_mp_t *mp, size_t size) in nxt_mp_alloc_small() argument
532 if (size <= mp->page_size / 2) { in nxt_mp_alloc_small()
534 index = nxt_mp_chunk_pages_index(mp, size); in nxt_mp_alloc_small()
563 page->size = (1 << index); in nxt_mp_alloc_small()
581 page->size = mp->page_size >> mp->chunk_size_shift; in nxt_mp_alloc_small()
588 page->size << mp->chunk_size_shift, p); in nxt_mp_alloc_small()
595 nxt_mp_get_small(nxt_mp_t *mp, nxt_queue_t *pages, size_t size) in nxt_mp_get_small() argument
613 if (size <= available) { in nxt_mp_get_small()
630 page->size = 0xFF; in nxt_mp_get_small()
638 page->u.taken += size; in nxt_mp_get_small()
683 cluster->size = mp->cluster_size; in nxt_mp_alloc_cluster()
711 nxt_mp_alloc_large(nxt_mp_t *mp, size_t alignment, size_t size, in nxt_mp_alloc_large() argument
722 if (nxt_slow_path(size >= 0xFFFFFFFF)) { in nxt_mp_alloc_large()
726 if (nxt_is_power_of_two(size)) { in nxt_mp_alloc_large()
732 p = nxt_memalign(alignment, size); in nxt_mp_alloc_large()
741 aligned_size = nxt_align_size(size, sizeof(uintptr_t)); in nxt_mp_alloc_large()
754 block->size = size; in nxt_mp_alloc_large()
848 } else if (p >= block->start + block->size) { in nxt_mp_find_block()
865 nxt_uint_t n, size, chunk; in nxt_mp_chunk_free() local
874 if (nxt_slow_path(page->size == 0)) { in nxt_mp_chunk_free()
878 if (nxt_slow_path(page->size == 0xFF)) { in nxt_mp_chunk_free()
882 size = page->size << mp->chunk_size_shift; in nxt_mp_chunk_free()
884 if (size != mp->page_size) { in nxt_mp_chunk_free()
887 chunk = offset / size; in nxt_mp_chunk_free()
889 if (nxt_slow_path(offset != chunk * size)) { in nxt_mp_chunk_free()
907 n = nxt_mp_chunk_pages_index(mp, size); in nxt_mp_chunk_free()
913 nxt_mp_free_junk(p, size); in nxt_mp_chunk_free()
931 page->size = 0; in nxt_mp_chunk_free()
934 nxt_mp_free_junk(p, size); in nxt_mp_chunk_free()
942 if (page->size != 0) { in nxt_mp_chunk_free()
973 nxt_mp_nget(nxt_mp_t *mp, size_t size) in nxt_mp_nget() argument
979 if (size <= mp->page_size) { in nxt_mp_nget()
980 p = nxt_mp_get_small(mp, &mp->nget_pages, size); in nxt_mp_nget()
983 p = nxt_mp_alloc_large(mp, NXT_MAX_ALIGNMENT, size, 0); in nxt_mp_nget()
988 p = nxt_mp_alloc_large(mp, NXT_MAX_ALIGNMENT, size, 0); in nxt_mp_nget()
992 nxt_debug_alloc("mp %p nget(%uz): %p", mp, size, p); in nxt_mp_nget()
999 nxt_mp_get(nxt_mp_t *mp, size_t size) in nxt_mp_get() argument
1005 if (size <= mp->page_size) { in nxt_mp_get()
1006 size = nxt_max(size, NXT_MAX_ALIGNMENT); in nxt_mp_get()
1007 p = nxt_mp_get_small(mp, &mp->get_pages, size); in nxt_mp_get()
1010 p = nxt_mp_alloc_large(mp, NXT_MAX_ALIGNMENT, size, 0); in nxt_mp_get()
1015 p = nxt_mp_alloc_large(mp, NXT_MAX_ALIGNMENT, size, 0); in nxt_mp_get()
1019 nxt_debug_alloc("mp %p get(%uz): %p", mp, size, p); in nxt_mp_get()
1026 nxt_mp_zget(nxt_mp_t *mp, size_t size) in nxt_mp_zget() argument
1030 p = nxt_mp_get(mp, size); in nxt_mp_zget()
1033 memset(p, 0, size); in nxt_mp_zget()
1065 nxt_mp_lvlhsh_alloc(void *pool, size_t size) in nxt_mp_lvlhsh_alloc() argument
1067 return nxt_mp_align(pool, size, size); in nxt_mp_lvlhsh_alloc()