From 01d61a3c6fa4664ba92f97bd75f4b513396b140e Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Mon, 13 Dec 2021 22:05:13 -0800 Subject: [PATCH] Fix a conversion warning. --- include/jemalloc/internal/cache_bin.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/jemalloc/internal/cache_bin.h b/include/jemalloc/internal/cache_bin.h index 76345be9..102c133f 100644 --- a/include/jemalloc/internal/cache_bin.h +++ b/include/jemalloc/internal/cache_bin.h @@ -371,13 +371,15 @@ cache_bin_alloc(cache_bin_t *bin, bool *success) { JEMALLOC_ALWAYS_INLINE cache_bin_sz_t cache_bin_alloc_batch(cache_bin_t *bin, size_t num, void **out) { - size_t n = cache_bin_ncached_get_internal(bin, /* racy */ false); + cache_bin_sz_t n = cache_bin_ncached_get_internal(bin, + /* racy */ false); if (n > num) { - n = num; + n = (cache_bin_sz_t)num; } memcpy(out, bin->stack_head, n * sizeof(void *)); bin->stack_head += n; cache_bin_low_water_adjust(bin); + return n; }