GithubHelp home page GithubHelp logo

chenyahui / annotatedcode Goto Github PK

View Code? Open in Web Editor NEW
1.4K 28.0 314.0 7.38 MB

知名开源代码库的注释版:C++、Golang等

Home Page: https://www.cyhone.com

CMake 0.86% Makefile 0.39% C++ 31.82% C 36.42% Assembly 0.02% Roff 0.29% Ruby 0.03% Shell 0.35% M4 0.23% Python 0.54% sed 0.01% HTML 0.13% Perl 0.14% Thrift 0.01% Java 0.21% Lua 0.02% Go 28.49% Starlark 0.05%

annotatedcode's Introduction

知名开源项目 - 注释版

本仓库是个人在阅读开源代码时,对代码所作的注释和部分讲解。

C/C++

项目名称 关键词 注释版 原地址 博客
libco 协程 注释版 原地址 微信libco协程库源码分析
coroutine 协程 注释版 原地址 云风coroutine协程库源码分析
libevent 网络库/reactor 注释版 原地址 暂无
sofa-pbrpc RPC 注释版 原地址 暂无
muduo 网络库/reactor 注释版 原地址 muduo源码剖析
Redis Redis 注释版 原地址 Redis事件循环器(AE)实现剖析

Golang

项目名称 关键词 注释版 原地址 博客
go/x/time/rate 限流器 注释版 原地址 Golang限流器time/rate实现剖析
ratelimit 限流器 注释版 原地址 uber-go 漏桶限流器使用与原理分析
groupcache 缓存/一致性Hash 注释版 原地址 一致性 Hash 原理及 GroupCache 源码分析
facebookgo/inject 依赖注入 注释版 原地址 Facebook 在 Golang 依赖注入的实现

Go源码及标准库

更多文章

更多文章欢迎关注博客编程沉思录: cyhone.com

xxx

annotatedcode's People

Contributors

chenyahui avatar timgates42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

annotatedcode's Issues

coroutine中的dummy是什么

static void
_save_stack(struct coroutine *C, char *top) {
// 这个dummy很关键,是求取整个栈的关键
// 这个非常经典,涉及到linux的内存分布,栈是从高地址向低地址扩展,因此
// S->stack + STACK_SIZE就是运行时栈的栈底
// dummy,此时在栈中,肯定是位于最底的位置的,即栈顶
// top - &dummy 即整个栈的容量
char dummy = 0;
assert(top - &dummy <= STACK_SIZE);
if (C->cap < top - &dummy) {
free(C->stack);
C->cap = top-&dummy;
C->stack = malloc(C->cap);
}
C->size = top - &dummy;
memcpy(C->stack, &dummy, C->size);
}

请问 top - &dummy为什么是整个栈的容量,栈的容量不应该是STACK_SIZE吗?。
dummy的定义为char dummy = 0; 它代表了什么含义。&dummy指的是什么地址呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.