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
c6fdebf5
Unverified
Commit
c6fdebf5
authored
Jun 19, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Jun 19, 2018
Browse files
Merge pull request #5042 from oranagra/malloc_usable_size_libc
add malloc_usable_size for libc malloc
parents
4da29630
482785ac
Changes
2
Show whitespace changes
Inline
Side-by-side
src/server.h
View file @
c6fdebf5
...
@@ -882,13 +882,13 @@ typedef struct rdbSaveInfo {
...
@@ -882,13 +882,13 @@ typedef struct rdbSaveInfo {
#define RDB_SAVE_INFO_INIT {-1,0,"000000000000000000000000000000",-1}
#define RDB_SAVE_INFO_INIT {-1,0,"000000000000000000000000000000",-1}
typedef
struct
malloc_stats
{
struct
malloc_stats
{
size_t
zmalloc_used
;
size_t
zmalloc_used
;
size_t
process_rss
;
size_t
process_rss
;
size_t
allocator_allocated
;
size_t
allocator_allocated
;
size_t
allocator_active
;
size_t
allocator_active
;
size_t
allocator_resident
;
size_t
allocator_resident
;
}
malloc_stats
;
};
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
* Global server state
* Global server state
...
@@ -995,7 +995,7 @@ struct redisServer {
...
@@ -995,7 +995,7 @@ struct redisServer {
long
long
slowlog_entry_id
;
/* SLOWLOG current entry ID */
long
long
slowlog_entry_id
;
/* SLOWLOG current entry ID */
long
long
slowlog_log_slower_than
;
/* SLOWLOG time limit (to get logged) */
long
long
slowlog_log_slower_than
;
/* SLOWLOG time limit (to get logged) */
unsigned
long
slowlog_max_len
;
/* SLOWLOG max number of items logged */
unsigned
long
slowlog_max_len
;
/* SLOWLOG max number of items logged */
malloc_stats
cron_malloc_stats
;
/* sampled in serverCron(). */
struct
malloc_stats
cron_malloc_stats
;
/* sampled in serverCron(). */
long
long
stat_net_input_bytes
;
/* Bytes read from network. */
long
long
stat_net_input_bytes
;
/* Bytes read from network. */
long
long
stat_net_output_bytes
;
/* Bytes written to network. */
long
long
stat_net_output_bytes
;
/* Bytes written to network. */
size_t
stat_rdb_cow_bytes
;
/* Copy on write bytes during RDB saving. */
size_t
stat_rdb_cow_bytes
;
/* Copy on write bytes during RDB saving. */
...
...
src/zmalloc.h
View file @
c6fdebf5
...
@@ -63,6 +63,11 @@
...
@@ -63,6 +63,11 @@
#ifndef ZMALLOC_LIB
#ifndef ZMALLOC_LIB
#define ZMALLOC_LIB "libc"
#define ZMALLOC_LIB "libc"
#ifdef __GLIBC__
#include <malloc.h>
#define HAVE_MALLOC_SIZE 1
#define zmalloc_size(p) malloc_usable_size(p)
#endif
#endif
#endif
/* We can enable the Redis defrag capabilities only if we are using Jemalloc
/* We can enable the Redis defrag capabilities only if we are using Jemalloc
...
...
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