| 504 | } |
| 505 | |
| 506 | int jemalloc_purge() { |
| 507 | /* return all unused (reserved) pages to the OS */ |
| 508 | char tmp[32]; |
| 509 | unsigned narenas = 0; |
| 510 | size_t sz = sizeof(unsigned); |
| 511 | if (!je_mallctl("arenas.narenas", &narenas, &sz, NULL, 0)) { |
| 512 | sprintf(tmp, "arena.%d.purge", narenas); |
| 513 | if (!je_mallctl(tmp, NULL, 0, NULL, 0)) |
| 514 | return 0; |
| 515 | } |
| 516 | return -1; |
| 517 | } |
| 518 | |
| 519 | #else |
| 520 |
no test coverage detected