Lines Matching refs:p

144 #define nxt_mp_free_junk(p, size)                                             \  argument
145 memset((p), 0x5A, size)
158 static nxt_mp_block_t *nxt_mp_find_block(nxt_rbtree_t *tree, const u_char *p);
160 u_char *p);
311 void *p; in nxt_mp_destroy() local
336 p = block->start; in nxt_mp_destroy()
342 nxt_free(p); in nxt_mp_destroy()
392 void *p; in nxt_mp_alloc() local
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()
411 return p; in nxt_mp_alloc()
418 void *p; in nxt_mp_zalloc() local
420 p = nxt_mp_alloc(mp, size); in nxt_mp_zalloc()
422 if (nxt_fast_path(p != NULL)) { in nxt_mp_zalloc()
423 memset(p, 0, size); in nxt_mp_zalloc()
426 return p; in nxt_mp_zalloc()
433 void *p; in nxt_mp_align() local
446 p = nxt_mp_alloc_small(mp, aligned_size); 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()
459 p = NULL; in nxt_mp_align()
462 nxt_debug_alloc("mp %p align(@%uz:%uz): %p", mp, alignment, size, p); in nxt_mp_align()
464 return p; in nxt_mp_align()
471 void *p; in nxt_mp_zalign() local
473 p = nxt_mp_align(mp, alignment, size); in nxt_mp_zalign()
475 if (nxt_fast_path(p != NULL)) { in nxt_mp_zalign()
476 memset(p, 0, size); in nxt_mp_zalign()
479 return p; in nxt_mp_zalign()
522 u_char *p; in nxt_mp_alloc_small() local
530 p = NULL; in nxt_mp_alloc_small()
542 p = nxt_mp_page_addr(mp, page); in nxt_mp_alloc_small()
547 p += ((n << index) << mp->chunk_size_shift); in nxt_mp_alloc_small()
573 p = nxt_mp_page_addr(mp, page); in nxt_mp_alloc_small()
583 p = nxt_mp_page_addr(mp, page); in nxt_mp_alloc_small()
588 page->size << mp->chunk_size_shift, p); in nxt_mp_alloc_small()
590 return p; in nxt_mp_alloc_small()
597 u_char *p; in nxt_mp_get_small() local
635 p = nxt_mp_page_addr(mp, page); in nxt_mp_get_small()
637 p += page->u.taken; in nxt_mp_get_small()
640 return p; in nxt_mp_get_small()
714 u_char *p; in nxt_mp_alloc_large() local
732 p = nxt_memalign(alignment, size); in nxt_mp_alloc_large()
733 if (nxt_slow_path(p == NULL)) { in nxt_mp_alloc_large()
743 p = nxt_memalign(alignment, aligned_size + sizeof(nxt_mp_block_t)); in nxt_mp_alloc_large()
744 if (nxt_slow_path(p == NULL)) { in nxt_mp_alloc_large()
748 block = (nxt_mp_block_t *) (p + aligned_size); in nxt_mp_alloc_large()
755 block->start = p; in nxt_mp_alloc_large()
759 return p; in nxt_mp_alloc_large()
784 nxt_mp_free(nxt_mp_t *mp, void *p) in nxt_mp_free() argument
791 nxt_debug_alloc("mp %p free(%p)", mp, p); in nxt_mp_free()
793 block = nxt_mp_find_block(&mp->blocks, p); in nxt_mp_free()
798 err = nxt_mp_chunk_free(mp, block, p); in nxt_mp_free()
804 } else if (nxt_fast_path(p == block->start)) { in nxt_mp_free()
813 nxt_free(p); in nxt_mp_free()
828 nxt_thread_log_alert(err, p); in nxt_mp_free()
833 nxt_mp_find_block(nxt_rbtree_t *tree, const u_char *p) in nxt_mp_find_block() argument
845 if (p < block->start) { in nxt_mp_find_block()
848 } else if (p >= block->start + block->size) { in nxt_mp_find_block()
861 nxt_mp_chunk_free(nxt_mp_t *mp, nxt_mp_block_t *cluster, u_char *p) in nxt_mp_chunk_free() argument
869 n = (p - cluster->start) >> mp->page_size_shift; in nxt_mp_chunk_free()
886 offset = (uintptr_t) (p - start) & (mp->page_size - 1); in nxt_mp_chunk_free()
913 nxt_mp_free_junk(p, size); in nxt_mp_chunk_free()
925 } else if (nxt_slow_path(p != start)) { in nxt_mp_chunk_free()
934 nxt_mp_free_junk(p, size); in nxt_mp_chunk_free()
963 p = cluster->start; in nxt_mp_chunk_free()
966 nxt_free(p); in nxt_mp_chunk_free()
975 void *p; in nxt_mp_nget() local
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()
994 return p; in nxt_mp_nget()
1001 void *p; in nxt_mp_get() local
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()
1021 return p; in nxt_mp_get()
1028 void *p; in nxt_mp_zget() local
1030 p = nxt_mp_get(mp, size); in nxt_mp_zget()
1032 if (nxt_fast_path(p != NULL)) { in nxt_mp_zget()
1033 memset(p, 0, size); in nxt_mp_zget()
1036 return p; in nxt_mp_zget()
1072 nxt_mp_lvlhsh_free(void *pool, void *p) in nxt_mp_lvlhsh_free() argument
1074 nxt_mp_free(pool, p); in nxt_mp_lvlhsh_free()