| 238 | } |
| 239 | |
| 240 | static 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 | |
| 266 | static inline void test_shm_malloc(void) |
| 267 | { |
no test coverage detected