[TOC]
准备好好学习下 Redis 了
《Redis 设计与实现(第二版)》
redis-3.0.0 带中文注释代码
redis 最新版代码
准备跟书看,同时对比下最新版代码,最后运行调试看下。
博客还不知道会不会更新。。。。
环境安装
我个人习惯用 vscode。
C/C++ 开发环境这里不展开了,参考这个搞下就行了
简单配置下就可以断点调试了
.vscode/launch.json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| { "version": "0.2.0", "configurations": [ { "name": "(redis-6.2.1) 启动", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/src/redis-server", "args": ["${workspaceFolder}/redis.conf"], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "MIMode": "lldb", "preLaunchTask": "build", "setupCommands": [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ] }
|
.vscode/tasks.json
1 2 3 4 5 6 7 8 9 10 11 12 13
| { "version": "2.0.0", "tasks": [ { "label": "build", "type": "shell", "command": "make", "args": [ "CFLAGS=\"-g -O0\"" ] } ] }
|
阅读内容
[ ] 数据结构
[ ] 基础数据结 sds ß
[x] sds (sds.h, sds.c, sdsalloc.h)
[x] list ()
[x] dict (dict.h, dict.c)
[ ] zkiplist
[ ] intset
[ ] ziplist
[ ] 外部数据结构(各类对象)
- [ ] 对象的类型和编码
- [ ] 字符串对象
- [ ] 列表对象
- [ ] 哈希对象
- [ ] 集合对象
- [ ] 有序集合对象