| 494 | #endif |
| 495 | |
| 496 | void |
| 497 | pages_set_thp_state (void *ptr, size_t size) { |
| 498 | if (opt_thp == thp_mode_default || opt_thp == init_system_thp_mode) { |
| 499 | return; |
| 500 | } |
| 501 | assert(opt_thp != thp_mode_not_supported && |
| 502 | init_system_thp_mode != thp_mode_not_supported); |
| 503 | |
| 504 | if (opt_thp == thp_mode_always |
| 505 | && init_system_thp_mode != thp_mode_never) { |
| 506 | assert(init_system_thp_mode == thp_mode_default); |
| 507 | pages_huge_unaligned(ptr, size); |
| 508 | } else if (opt_thp == thp_mode_never) { |
| 509 | assert(init_system_thp_mode == thp_mode_default || |
| 510 | init_system_thp_mode == thp_mode_always); |
| 511 | pages_nohuge_unaligned(ptr, size); |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | static void |
| 516 | init_thp_state(void) { |
no test coverage detected