diff --git a/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp b/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp index ef0b22a3d..e597fa279 100644 --- a/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp +++ b/examples/convert-llama2c-to-ggml/convert-llama2c-to-ggml.cpp @@ -471,12 +471,12 @@ struct my_llama_file { GGML_ASSERT(ret == 0); // same } - void read_raw(void * ptr, size_t size_cur) { - if (size_cur == 0) { + void read_raw(void * raw_addr, size_t raw_size) { + if (raw_size == 0) { return; } errno = 0; - std::size_t ret = std::fread(ptr, size_cur, 1, fp); + std::size_t ret = std::fread(raw_addr, raw_size, 1, fp); if (ferror(fp)) { die_fmt("fread failed: %s", strerror(errno)); } diff --git a/src/llama-mmap.cpp b/src/llama-mmap.cpp index db4c4bcbe..7f43bccda 100644 --- a/src/llama-mmap.cpp +++ b/src/llama-mmap.cpp @@ -454,8 +454,8 @@ struct llama_mlock::impl { return (size_t) sysconf(_SC_PAGESIZE); } - bool raw_lock(const void * addr_cur, size_t size_cur) const { - if (!mlock(addr_cur, size_cur)) { + bool raw_lock(const void * lock_addr, size_t lock_len) const { + if (!mlock(lock_addr, lock_len)) { return true; } @@ -475,12 +475,12 @@ struct llama_mlock::impl { if (suggest && getrlimit(RLIMIT_MEMLOCK, &lock_limit)) { suggest = false; } - if (suggest && (lock_limit.rlim_max > lock_limit.rlim_cur + size_cur)) { + if (suggest && (lock_limit.rlim_max > lock_limit.rlim_cur + lock_len)) { suggest = false; } LLAMA_LOG_WARN("warning: failed to mlock %zu-byte buffer (after previously locking %zu bytes): %s\n%s", - size_cur, size, errmsg, suggest ? MLOCK_SUGGESTION : ""); + lock_len, size, errmsg, suggest ? MLOCK_SUGGESTION : ""); return false; } @@ -535,7 +535,7 @@ struct llama_mlock::impl { return (size_t) 65536; } - bool raw_lock(const void * addr_cur, size_t size_cur) const { + bool raw_lock(const void * lock_addr, size_t lock_len) const { LLAMA_LOG_WARN("warning: mlock not supported on this system\n"); return false; }