MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / test_pkg_malloc

Function test_pkg_malloc

mem/test/test_malloc.c:240–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240static inline void test_pkg_malloc(void)
241{
242 MALLOC = osips_pkg_malloc;
243 REALLOC = osips_pkg_realloc;
244 FREE = osips_pkg_free;
245
246 LM_INFO("Starting PKG stress test...\n");
247 LM_INFO("================================\n");
248
249 _test_malloc(1, pkg_frag_overhead);
250
251 LM_INFO("PKG test complete. Final stats:\n");
252 LM_INFO("================================\n");
253
254 LM_INFO("mallocs %ld : %ld aligned-mallocs\n", mallocs, aligned_mallocs);
255 LM_INFO("reallocs %ld : %ld aligned-reallocs\n", reallocs, aligned_reallocs);
256 LM_INFO("frees %ld\n", frees);
257
258 ok(mallocs == aligned_mallocs, "check pkg_malloc() alignment");
259 ok(reallocs == aligned_reallocs, "check pkg_realloc() alignment");
260
261 mallocs = aligned_mallocs = 0;
262 reallocs = aligned_reallocs = 0;
263 frees = 0;
264}
265
266static inline void test_shm_malloc(void)
267{

Callers 1

test_mallocFunction · 0.85

Calls 1

_test_mallocFunction · 0.85

Tested by

no test coverage detected