summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJefty Negapatan <jefty.dev@gmail.com>2020-04-05 14:38:08 +0200
committerdormando <dormando@rydia.net>2020-04-10 17:29:59 -0700
commitc700682b6f3e2a51681f9ba5c3245501527d81fe (patch)
treefb3b23490c8f8b1f286da9ed0701a1028f2faaff
parent651380cd4863033f4668f09c6a96819044e11f69 (diff)
downloadmemcached-c700682b6f3e2a51681f9ba5c3245501527d81fe.tar.gz
Fix t/64bit.t test failure in Windows.
t/64bit.t .. 1/6 Failed test 'expected (faked) value of total_malloced' at t/64bit.t line 30. got: '32' expected: '4294967328' Failed test 'hit size limit' at t/64bit.t line 41. In Windows, long is just 32-bit even for 64-bit platforms.
-rw-r--r--slabs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/slabs.c b/slabs.c
index ca8a8f2..047d45a 100644
--- a/slabs.c
+++ b/slabs.c
@@ -279,7 +279,10 @@ void slabs_init(const size_t limit, const double factor, const bool prealloc, co
{
char *t_initial_malloc = getenv("T_MEMD_INITIAL_MALLOC");
if (t_initial_malloc) {
- mem_malloced = (size_t)atol(t_initial_malloc);
+ int64_t env_malloced;
+ if (safe_strtoll((const char *)t_initial_malloc, &env_malloced)) {
+ mem_malloced = (size_t)env_malloced;
+ }
}
}