MCPcopy Create free account
hub / github.com/F-Stack/f-stack / malloc_domain

Function malloc_domain

freebsd/kern/kern_malloc.c:671–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669}
670
671static void *
672malloc_domain(size_t *sizep, int *indxp, struct malloc_type *mtp, int domain,
673 int flags)
674{
675 uma_zone_t zone;
676 caddr_t va;
677 size_t size;
678 int indx;
679
680 size = *sizep;
681 KASSERT(size <= kmem_zmax && (flags & M_EXEC) == 0,
682 ("malloc_domain: Called with bad flag / size combination."));
683 if (size & KMEM_ZMASK)
684 size = (size & ~KMEM_ZMASK) + KMEM_ZBASE;
685 indx = kmemsize[size >> KMEM_ZSHIFT];
686 zone = kmemzones[indx].kz_zone[mtp_get_subzone(mtp)];
687 va = uma_zalloc_domain(zone, NULL, domain, flags);
688 if (va != NULL)
689 *sizep = zone->uz_size;
690 *indxp = indx;
691 return ((void *)va);
692}
693
694void *
695malloc_domainset(size_t size, struct malloc_type *mtp, struct domainset *ds,

Callers 1

malloc_domainsetFunction · 0.85

Calls 2

mtp_get_subzoneFunction · 0.85
uma_zalloc_domainFunction · 0.85

Tested by

no test coverage detected