MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / grow_to

Method grow_to

llama.cpp:1065–1079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 3

load_all_dataMethod · 0.45
llm_load_tensorsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected