Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
965905c9
Commit
965905c9
authored
Jul 07, 2016
by
antirez
Browse files
Move the struct evictionPoolEntry() into only file using it.
Local scope is always better when possible.
parent
d8e92a82
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/evict.c
View file @
965905c9
...
...
@@ -33,6 +33,27 @@
#include "server.h"
#include "bio.h"
/* ----------------------------------------------------------------------------
* Data structures
* --------------------------------------------------------------------------*/
/* To improve the quality of the LRU approximation we take a set of keys
* that are good candidate for eviction across freeMemoryIfNeeded() calls.
*
* Entries inside the eviciton pool are taken ordered by idle time, putting
* greater idle times to the right (ascending order).
*
* Empty entries have the key pointer set to NULL. */
#define MAXMEMORY_EVICTION_POOL_SIZE 16
struct
evictionPoolEntry
{
unsigned
long
long
idle
;
/* Object idle time. */
sds
key
;
/* Key name. */
};
/* ----------------------------------------------------------------------------
* Implementation of eviction, aging and LRU
* --------------------------------------------------------------------------*/
/* Return the LRU clock, based on the clock resolution. This is a time
* in a reduced-bits format that can be used to set and check the
* object->lru field of redisObject structures. */
...
...
src/server.h
View file @
965905c9
...
...
@@ -550,18 +550,7 @@ typedef struct redisObject {
_var.ptr = _ptr; \
} while(0)
/* To improve the quality of the LRU approximation we take a set of keys
* that are good candidate for eviction across freeMemoryIfNeeded() calls.
*
* Entries inside the eviciton pool are taken ordered by idle time, putting
* greater idle times to the right (ascending order).
*
* Empty entries have the key pointer set to NULL. */
#define MAXMEMORY_EVICTION_POOL_SIZE 16
struct
evictionPoolEntry
{
unsigned
long
long
idle
;
/* Object idle time. */
sds
key
;
/* Key name. */
};
struct
evictionPoolEntry
;
/* Defined in evict.c */
/* Redis database representation. There are multiple databases identified
* by integers from 0 (the default database) up to the max configured
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment