From c0c9230c73224f5364c7e23ddeee0e42991e5f8e Mon Sep 17 00:00:00 2001 From: Alex Cope Date: Fri, 7 Jul 2023 11:37:09 -0700 Subject: [PATCH] fix compile error --- src/evict.cpp | 8 -------- src/server.h | 8 +++++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/evict.cpp b/src/evict.cpp index 0f8c2bf6b..740a6d2b2 100644 --- a/src/evict.cpp +++ b/src/evict.cpp @@ -36,9 +36,6 @@ #include #include #include -#ifdef __linux__ -#include -#endif /* ---------------------------------------------------------------------------- * Data structures @@ -66,11 +63,6 @@ struct evictionPoolEntry { static struct evictionPoolEntry *EvictionPoolLRU; -enum class EvictReason { - User, /* User memory exceeded limit */ - System /* System memory exceeded limit */ -}; - /* ---------------------------------------------------------------------------- * Implementation of eviction, aging and LRU * --------------------------------------------------------------------------*/ diff --git a/src/server.h b/src/server.h index 612165c0f..047834ae2 100644 --- a/src/server.h +++ b/src/server.h @@ -2874,6 +2874,12 @@ typedef struct { #define OBJ_HASH_KEY 1 #define OBJ_HASH_VALUE 2 +/* Used in evict.cpp */ +enum class EvictReason { + User, /* User memory exceeded limit */ + System /* System memory exceeded limit */ +}; + /*----------------------------------------------------------------------------- * Extern declarations *----------------------------------------------------------------------------*/ @@ -3378,7 +3384,7 @@ int zslLexValueGteMin(sds value, zlexrangespec *spec); int zslLexValueLteMax(sds value, zlexrangespec *spec); /* Core functions */ -int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *level, int *reason=NULL, bool fQuickCycle=false, bool fPreSnapshot=false); +int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *level, EvictReason *reason=NULL, bool fQuickCycle=false, bool fPreSnapshot=false); size_t freeMemoryGetNotCountedMemory(); int overMaxmemoryAfterAlloc(size_t moremem); int processCommand(client *c, int callFlags);