Skip to content

Commit 6a3c7ee

Browse files
committed
llama : fix signed comparison warning on FreeBSD
This ensures correct RLIM_INFINITY handling and compatibility on all platforms (32/64-bit). warning: comparison of integers of different signs: 'rlim_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare] 488 | if (suggest && (lock_limit.rlim_max > lock_limit.rlim_cur + size)) { | ~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Adrien Gallouët <[email protected]>
1 parent 134e694 commit 6a3c7ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/llama-mmap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ struct llama_mlock::impl {
485485
if (suggest && getrlimit(RLIMIT_MEMLOCK, &lock_limit)) {
486486
suggest = false;
487487
}
488-
if (suggest && (lock_limit.rlim_max > lock_limit.rlim_cur + size)) {
488+
if (suggest && ((uint64_t)lock_limit.rlim_max > (uint64_t)lock_limit.rlim_cur + size)) {
489489
suggest = false;
490490
}
491491
#endif

0 commit comments

Comments
 (0)