Introduction
Hash table is one of the core structures of redis. In redis source code, dict. c and dict. h defines the hash structure used by redis. In this article, we will. c and dict. h.
Because dict. the implementation of the separate chaining hash table used in c can be
Source code version: redis 2.4.4
Redis memory-related functions are stored in zmalloc. h zmalloc. C.Redis can use tcmalloc and jemallocMakefile:
ifeq ($(USE_TCMALLOC),yes) ALLOC_DEP= ALLOC_LINK=-ltcmalloc ALLOC_FLAGS=-DUSE_TCMALLOCendififeq ($(USE_JEMALLOC),yes) ALLOC_DEP=../deps/jemalloc/lib/libjemalloc.a ALLOC_L
larger strings, using the arbitrary value * of 32 bytes. this code was backported from the unstable branch * where this is already med when the object is too large to be * encoded as EMBSTR. */if (len> 32 o-> encoding = REDIS_ENCODING_RAW sdsavail (s)> len/10) {// call sdsRemoveFreeSpace to remove the spaces in the string 0-> ptr from o-> ptr = sdsRemoveFreeSpace (o-> ptr);}/* Return the original object. */return o ;}.....Removes the space occupied
Redis source code parsing (1): Introduction, redis source code parsing IntroductionZookeeper
The author of Redis, Salvatore Sanfilippo, is from Sicily, Italy and now lives in Catania. H
Anatomy of a Redis network connection library
1. Introduction to Redis Network Connection library
The file that corresponds to the Redis network Connection library is networking.c. This file is primarily responsible for client creation and release commands receive and command reply REDIS Communication Protocol
Analysis of the Redis source code for nearly 1 months, but also to the most core, closest to the beginning of the system, I named him the main directory, which included 2 important documents, REDIS-CLI and Redis files, 1 represent
The last time just analyzed the client structure analysis, thinking more simple, clear, and finally learning is the implementation of the service end, the service in Redis but the heavy, which basically contains the previous modules involved in all the points of knowledge, from the Redis of the head file can be seen, Redis.h The amount of
Latencysample acquisition point structure definition:
/* Representation of a latency sample:the sampling time and the latency * observed in milliseconds.////
Delay sample * *
struct Latencysample {
//Delay Sample creation time
int32_t/* We don ' t use time_t to force 4 bytes Usage everywhe Re. * *
//delay time, in milliseconds
uint32_t latency/* latency in milliseconds. */
};The dictionary does not maintain a sample node, but rather a node list structure:
/* The Latency Time ser
converted into memory-mapped models using encoding). The former is used to hold the long type data, which is used to hold Sds/char*,long long,long double,double type data. The string type is basically implemented by the operation function of the SDS data structure, here is just a simple example, and nothing else to say./* Appends a string to the specified string and indicates an increased memory space */sds Sdscatlen (SDS s, const void *t, size_t len) {//Declaration string sh struct SDSHDR *
The cornerstone of Redis memory management ZMALLC.C Source code interpretation (a)
The cornerstone of Redis memory management ZMALLC.C Source code interpretation (ii)
The previous two posts, detailed introduction of the Z
Time passed quickly, after 1 months of time to learn, I Redis source code analysis has been more than half of the previous study, I mainly for the Redis tool class code to learn. The next few days I'm going to learn about the impl
Tomcat source code analysis-component startup implementation analysis, tomcat source code analysis component
Tomcat is composed of multiple components. How does Tomcat manage its lifecy
, indicates a permanent cache return New string[] {"value1","value2" }; }}Third, source code analysis
Source code in the Github.com/aspnet/caching,redis source is relatively simple, mai
between different buckets). Take a look at the RDB-related content below.1. rdb file formatThe Rdb file format is relatively simple and can be seen as a sequence of instructions, consisting of each instruction:|-----------------------|----------------------------------|| OP Code:1byte | Instruction:nbytes ||-----------------------|----------------------------------|When an RDB is loaded, this sequence of instructions is parsed. All op
JDK source code-AQS source code analysis, jdk source code aqs
Unless otherwise specified, all the articles on this site are original. For reprinted articles, enter the address.
Abstrac
>= Te->when_ms)) {//In the callback handler, it is possible to add a new timer event, if you continue to join, there is a risk of a dead loop, so you need to avoid this situation, each cycle does not handle the newly added events, which is implemented by the following code. if (Te->id > Maxid) { te = te->next; Continue; }The event Loop section is analyzed to the end, feeling more intuitive, clear, comple
Compile the source code on CentOS5Redhat5 and install Redis | InstallRedisonCentOS5Redhat5
Compile the source code on CentOS 5/Redhat 5 to Install Redis | Install Redis on CentOS 5/Redh
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.