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

Function XX_MallocSmartInit

freebsd/contrib/ncsw/user/env/xx.c:185–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185int
186XX_MallocSmartInit(void)
187{
188 int error;
189
190 error = E_OK;
191 mtx_lock(&XX_MallocSmartLock);
192
193 if (XX_MallocSmartPool)
194 goto out;
195
196 /* Allocate MallocSmart pool */
197 XX_MallocSmartPool = contigmalloc(MALLOCSMART_POOL_SIZE, M_NETCOMMSW,
198 M_NOWAIT, 0, 0xFFFFFFFFFull, MALLOCSMART_POOL_SIZE, 0);
199 if (!XX_MallocSmartPool) {
200 error = E_NO_MEMORY;
201 goto out;
202 }
203
204out:
205 mtx_unlock(&XX_MallocSmartLock);
206 return (error);
207}
208
209void *
210XX_MallocSmart(uint32_t size, int memPartitionId, uint32_t alignment)

Callers

nothing calls this directly

Calls 3

contigmallocFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected