diff --git a/llama.cpp b/llama.cpp index c129b1640..d2d74b025 100644 --- a/llama.cpp +++ b/llama.cpp @@ -3175,6 +3175,8 @@ struct llama_model_loader { void init_mappings(bool prefetch = true, std::vector> * mlock_mmaps = nullptr) { if (use_mmap) { + mappings.reserve(files.size()); + mmaps_used.reserve(files.size()); for (const auto & file : files) { auto * mapping = new llama_mmap(file.get(), prefetch ? -1 : 0, ggml_is_numa()); mmaps_used.emplace_back(std::make_pair(mapping->size, 0));