| 1063 | } |
| 1064 | |
| 1065 | void grow_to(size_t target_size) { |
| 1066 | GGML_ASSERT(addr); |
| 1067 | if (failed_already) { |
| 1068 | return; |
| 1069 | } |
| 1070 | size_t granularity = lock_granularity(); |
| 1071 | target_size = (target_size + granularity - 1) & ~(granularity - 1); |
| 1072 | if (target_size > size) { |
| 1073 | if (raw_lock((uint8_t *) addr + size, target_size - size)) { |
| 1074 | size = target_size; |
| 1075 | } else { |
| 1076 | failed_already = true; |
| 1077 | } |
| 1078 | } |
| 1079 | } |
| 1080 | |
| 1081 | #ifdef _POSIX_MEMLOCK_RANGE |
| 1082 | static constexpr bool SUPPORTED = true; |
no outgoing calls
no test coverage detected