Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTERNAL: Move a default_topkeys variable #783

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ union mc_engine mc_engine;
static conn *listen_conn = NULL;
static struct event_base *main_base;
struct thread_stats *default_thread_stats;
topkeys_t *default_topkeys = NULL;

#ifdef ENABLE_ZK_INTEGRATION
static char *arcus_zk_cfg = NULL;
Expand Down
1 change: 0 additions & 1 deletion memcached.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ struct conn {
*/
/* The external variables used in below macros */
extern struct thread_stats *default_thread_stats;
extern topkeys_t *default_topkeys;

#define MY_THREAD_STATS(c) (&default_thread_stats[(c)->thread->index])

Expand Down
2 changes: 2 additions & 0 deletions topkeys.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <memcached/genhash.h>
#include "topkeys.h"

topkeys_t *default_topkeys = NULL;

static topkey_item_t *topkey_item_init(const void *key, int nkey, rel_time_t ctime)
{
topkey_item_t *item = calloc(sizeof(topkey_item_t) + nkey, 1);
Expand Down
2 changes: 2 additions & 0 deletions topkeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ typedef struct topkeys {
int max_keys;
} topkeys_t;

extern topkeys_t *default_topkeys;

topkeys_t *topkeys_init(int max_keys);
void topkeys_free(topkeys_t *topkeys);
topkey_item_t *topkeys_item_get_or_create(topkeys_t *tk,
Expand Down
Loading