/freebsd/lib/libc/tests/string/ |
H A D | memccpy_test.c | 49 size_t alloc_size, page_size; in makebuf() local 52 alloc_size = roundup2(len, page_size) + page_size; in makebuf() 54 buf = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, MAP_ANON, -1, 0); in makebuf() 57 assert(mprotect(buf + alloc_size - page_size, page_size, PROT_NONE) == 0); in makebuf() 58 return (buf + alloc_size - page_size - len); in makebuf() 68 size_t alloc_size, page_size; in freebuf() local 71 alloc_size = roundup2(len, page_size) + page_size; in freebuf() 74 munmap(buf + len + page_size - alloc_size, alloc_size); in freebuf() 76 munmap(buf - page_size, alloc_size); in freebuf()
|
H A D | wcsnlen_test.c | 41 size_t alloc_size, page_size; in makebuf() local 44 alloc_size = roundup2(len, page_size) + page_size; in makebuf() 46 buf = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, MAP_ANON, -1, 0); in makebuf() 49 ATF_CHECK(munmap(buf + alloc_size - page_size, page_size) == 0); in makebuf() 50 return (buf + alloc_size - page_size - len); in makebuf()
|
H A D | strlcpy_test.c | 48 size_t alloc_size, page_size; in makebuf() local 51 alloc_size = roundup2(len, page_size) + page_size; in makebuf() 53 buf = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, MAP_ANON, -1, 0); in makebuf() 56 assert(munmap(buf + alloc_size - page_size, page_size) == 0); in makebuf() 57 return (buf + alloc_size - page_size - len); in makebuf()
|
H A D | stpncpy_test.c | 47 size_t alloc_size, page_size; in makebuf() local 50 alloc_size = roundup2(len, page_size) + page_size; in makebuf() 52 buf = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, MAP_ANON, -1, 0); in makebuf() 55 assert(munmap(buf + alloc_size - page_size, page_size) == 0); in makebuf() 56 return (buf + alloc_size - page_size - len); in makebuf()
|
/freebsd/sys/dev/ixl/ |
H A D | ixl_pf_qmgr.c | 60 u16 alloc_size; in ixl_pf_qmgr_alloc_contiguous() local 66 alloc_size = (u16)next_power_of_two(num); in ixl_pf_qmgr_alloc_contiguous() 70 if (avail < alloc_size) in ixl_pf_qmgr_alloc_contiguous() 73 block_start = ixl_pf_qmgr_find_free_contiguous_block(qmgr, alloc_size); in ixl_pf_qmgr_alloc_contiguous() 78 for (i = block_start; i < block_start + alloc_size; i++) in ixl_pf_qmgr_alloc_contiguous() 85 qtag->num_allocated = alloc_size; in ixl_pf_qmgr_alloc_contiguous() 99 u16 alloc_size; in ixl_pf_qmgr_alloc_scattered() local 105 alloc_size = (u16)next_power_of_two(num); in ixl_pf_qmgr_alloc_scattered() 108 if (avail < alloc_size) in ixl_pf_qmgr_alloc_scattered() 115 qtag->num_allocated = alloc_size; in ixl_pf_qmgr_alloc_scattered() [all …]
|
/freebsd/tests/sys/vm/stack/ |
H A D | stack_mprotect_exec_test.c | 30 size_t alloc_size; in ATF_TC_BODY() local 37 alloc_size = SGROWSIZ * 2; in ATF_TC_BODY() 38 addr = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, in ATF_TC_BODY() 45 guard = addr + alloc_size - SGROWSIZ; in ATF_TC_BODY()
|
/freebsd/sys/net/route/ |
H A D | nhgrp.c | 231 size_t alloc_size; in consider_resize() local 235 alloc_size = CHT_SLIST_GET_RESIZE_SIZE(new_gr_bucket); in consider_resize() 236 gr_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); in consider_resize() 241 alloc_size = bitmask_get_size(new_idx_items); in consider_resize() 242 gr_idx_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); in consider_resize() 278 size_t alloc_size; in nhgrp_ctl_alloc_default() local 285 alloc_size = CHT_SLIST_GET_RESIZE_SIZE(num_buckets); in nhgrp_ctl_alloc_default() 286 cht_ptr = malloc(alloc_size, M_NHOP, malloc_flags); in nhgrp_ctl_alloc_default()
|
H A D | nhop.c | 79 size_t alloc_size; in nhops_init_rib() local 90 alloc_size = CHT_SLIST_GET_RESIZE_SIZE(num_buckets); in nhops_init_rib() 91 ptr = malloc(alloc_size, M_NHOP, M_WAITOK | M_ZERO); in nhops_init_rib() 237 size_t alloc_size; in consider_resize() local 241 alloc_size = CHT_SLIST_GET_RESIZE_SIZE(new_nh_buckets); in consider_resize() 242 nh_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); in consider_resize() 247 alloc_size = bitmask_get_size(new_idx_items); in consider_resize() 248 nh_idx_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); in consider_resize()
|
/freebsd/sys/compat/linuxkpi/common/include/linux/ |
H A D | scatterlist.h | 234 unsigned int alloc_size = table->orig_nents; in __sg_free_table() 237 if (alloc_size > max_ents) { in __sg_free_table() 239 alloc_size = max_ents; in __sg_free_table() 240 sg_size = alloc_size - 1; in __sg_free_table() 242 sg_size = alloc_size; in __sg_free_table() 250 free_fn(sgl, alloc_size); in __sg_free_table() 279 unsigned int alloc_size = left; in __sg_alloc_table() 281 if (alloc_size > max_ents) { in __sg_alloc_table() 282 alloc_size = max_ents; in __sg_alloc_table() 283 sg_size = alloc_size in __sg_alloc_table() 231 unsigned int alloc_size = table->orig_nents; __sg_free_table() local 276 unsigned int alloc_size = left; __sg_alloc_table() local [all...] |
/freebsd/sys/dev/usb/ |
H A D | usb_mbuf.c | 70 usb_size_t alloc_size; in usb_alloc_mbufs() local 76 alloc_size = (block_size + sizeof(struct usb_mbuf)) * nblocks; in usb_alloc_mbufs() 78 free_ptr = malloc(alloc_size, type, M_WAITOK | M_ZERO); in usb_alloc_mbufs()
|
/freebsd/contrib/jemalloc/src/ |
H A D | pages.c | 101 os_pages_trim(void *addr, size_t alloc_size, size_t leadsize, size_t size, in os_pages_trim() argument 105 assert(alloc_size >= leadsize + size); in os_pages_trim() 107 os_pages_unmap(addr, alloc_size); in os_pages_trim() 117 size_t trailsize = alloc_size - leadsize - size; in os_pages_trim() 158 size_t alloc_size = size + alignment - os_page; in pages_map_slow() local 160 if (alloc_size < size) { in pages_map_slow() 166 void *pages = os_pages_map(NULL, alloc_size, alignment, commit); in pages_map_slow() 172 ret = os_pages_trim(pages, alloc_size, leadsize, size, commit); in pages_map_slow()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/hwasan/ |
H A D | hwasan_fuchsia.cpp | 71 uptr alloc_size = UINT64_C(1) << kShadowBaseAlignment; in InitThreads() local 73 MmapAlignedOrDieOnFatalError(alloc_size, alloc_size, __func__)); in InitThreads() 75 InitThreadList(thread_start, alloc_size); in InitThreads()
|
/freebsd/sys/contrib/openzfs/include/os/linux/spl/sys/ |
H A D | vmem.h | 95 __attribute__((malloc, alloc_size(1))); 97 __attribute__((malloc, alloc_size(1)));
|
H A D | kmem.h | 189 __attribute__((malloc, alloc_size(1))) 191 __attribute__((malloc, alloc_size(1)))
|
/freebsd/sys/contrib/openzfs/lib/libspl/include/ |
H A D | umem.h | 86 __attribute__((malloc, alloc_size(1))) 99 __attribute__((malloc, alloc_size(1))) 121 __attribute__((malloc, alloc_size(1)))
|
/freebsd/sys/dev/drm2/ttm/ |
H A D | ttm_page_alloc.c | 84 unsigned alloc_size; member 245 m->options.alloc_size = val; 261 val = m->options.alloc_size; 619 unsigned alloc_size = _manager->options.alloc_size; in ttm_page_pool_fill_locked() local 629 ttm_flags, cstate, alloc_size); in ttm_page_pool_fill_locked() 635 pool->npages += alloc_size; in ttm_page_pool_fill_locked() 823 _manager->options.alloc_size = NUM_PAGES_TO_ALLOC; in ttm_page_alloc_init()
|
/freebsd/sys/dev/smartpqi/ |
H A D | smartpqi_queue.c | 153 uint32_t alloc_size = 0; in pqisrc_allocate_and_init_inbound_q() local 161 alloc_size = ib_array_size + PQI_CI_PI_ALIGN + PQI_ADDR_ALIGN; /* for IB CI and OB PI */ in pqisrc_allocate_and_init_inbound_q() 166 dma_mem->size = alloc_size; in pqisrc_allocate_and_init_inbound_q() 205 ASSERT(virt_addr <= ((char*)dma_mem->virt_addr + alloc_size)); in pqisrc_allocate_and_init_inbound_q() 225 uint32_t alloc_size = 0; in pqisrc_allocate_and_init_outbound_q() local 233 alloc_size = ob_array_size + PQI_CI_PI_ALIGN + PQI_ADDR_ALIGN; /* for OB PI */ in pqisrc_allocate_and_init_outbound_q() 238 dma_mem->size = alloc_size; in pqisrc_allocate_and_init_outbound_q() 275 ASSERT(virt_addr <= ((char*)dma_mem->virt_addr + alloc_size)); in pqisrc_allocate_and_init_outbound_q()
|
H A D | smartpqi_event.c | 389 uint32_t alloc_size = sizeof(pqi_event_config_t) ; in pqisrc_report_event_config() local 396 buf_report_event.size = alloc_size; in pqisrc_report_event_config() 450 uint32_t alloc_size = sizeof(pqi_event_config_t); in pqisrc_set_event_config() local 457 buf_set_event.size = alloc_size; in pqisrc_set_event_config()
|
/freebsd/contrib/ofed/opensm/complib/ |
H A D | cl_vector.c | 337 size_t alloc_size; in cl_vector_set_capacity() local 376 alloc_size = new_elements * p_vector->element_size; in cl_vector_set_capacity() 378 p_buf = (cl_list_item_t *) malloc(alloc_size + sizeof(cl_list_item_t)); in cl_vector_set_capacity() 382 memset(p_buf, 0, alloc_size + sizeof(cl_list_item_t)); in cl_vector_set_capacity()
|
/freebsd/sys/arm64/arm64/ |
H A D | busdma_bounce.c | 77 size_t alloc_size; member 283 newtag->alloc_size = newtag->common.maxsize; in bounce_bus_dma_tag_create() 293 newtag->alloc_size = roundup2(newtag->common.maxsize, in bounce_bus_dma_tag_create() 570 if (dmat->alloc_size <= PAGE_SIZE && in bounce_bus_dmamem_alloc() 574 *vaddr = malloc_domainset_aligned(dmat->alloc_size, in bounce_bus_dmamem_alloc() 578 howmany(dmat->alloc_size, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && in bounce_bus_dmamem_alloc() 583 DOMAINSET_PREF(dmat->common.domain), dmat->alloc_size, in bounce_bus_dmamem_alloc() 588 DOMAINSET_PREF(dmat->common.domain), dmat->alloc_size, in bounce_bus_dmamem_alloc() 626 kmem_free(vaddr, dmat->alloc_size); in bounce_bus_dmamem_free()
|
/freebsd/sys/geom/ |
H A D | geom_dev.c | 675 size_t alloc_size; in g_dev_ioctl() local 680 alloc_size = 0; in g_dev_ioctl() 687 alloc_size = rep->entries_allocated * in g_dev_ioctl() 689 if (alloc_size != 0) in g_dev_ioctl() 690 new_entries = g_malloc(alloc_size, in g_dev_ioctl() 697 alloc_size != 0 && error == 0) in g_dev_ioctl() 698 error = copyout(new_entries, old_entries, alloc_size); in g_dev_ioctl()
|
/freebsd/sys/ofed/drivers/infiniband/core/ |
H A D | ib_uverbs_uapi.c | 16 static void *uapi_add_elm(struct uverbs_api *uapi, u32 key, size_t alloc_size) in uapi_add_elm() argument 24 elm = kzalloc(alloc_size, GFP_KERNEL); in uapi_add_elm() 37 size_t alloc_size, bool *exists) in uapi_add_get_elm() argument 41 elm = uapi_add_elm(uapi, key, alloc_size); in uapi_add_get_elm()
|
/freebsd/sys/vm/ |
H A D | vm_phys.c | 1894 vm_phys_early_alloc(int domain, size_t alloc_size) in vm_phys_early_alloc() argument 1940 if (phys_avail[i+1] - alloc_size < mem_start || in vm_phys_early_alloc() 1949 alloc_size = round_page(alloc_size); in vm_phys_early_alloc() 1954 if (alloc_size == PAGE_SIZE) { in vm_phys_early_alloc() 1964 align = phys_avail[biggestone + 1] & (alloc_size - 1); in vm_phys_early_alloc() 1965 if (alloc_size + align > biggestsize) in vm_phys_early_alloc() 1973 phys_avail[biggestone + 1] -= alloc_size; in vm_phys_early_alloc()
|
/freebsd/sys/contrib/openzfs/include/os/freebsd/spl/sys/ |
H A D | kmem.h | 79 __attribute__((malloc, alloc_size(1)))
|
/freebsd/contrib/llvm-project/lldb/source/Expression/ |
H A D | IRMemoryMap.cpp | 91 size_t alloc_size = back->second.m_size; in FindSpace() local 92 ret = llvm::alignTo(addr + alloc_size, 4096); in FindSpace() 180 size_t alloc_size = back->second.m_size; in FindSpace() local 184 ret = llvm::alignTo(addr + alloc_size, align); in FindSpace()
|