nginx 源码阅读 core
ngx_config.h
数据对齐
#define ngx_align(d, a) (((d) + (a - 1)) & ~(a - 1))
ngx_core.h
#define ngx_abs(value) (((value) >= 0) ? (value) : - (value))
#define ngx_max(val1, val2) ((val1 < val2) ? (val2) : (val1))
#define ngx_min(val1, val2) ((val1 > val2) ? (val2) : (val1))
数据结构
ngx_array
typedef struct {
void *elts;
ngx_uint_t nelts;
size_t size;
ngx_uint_t nalloc;
ngx_pool_t *pool;
} ngx_array_t;
ngx_palloc.h
内存池
typedef struct ngx_pool_cleanup_s ngx_pool_cleanup_t;
struct ngx_pool_cleanup_s {
ngx_pool_cleanup_pt handler;
void *data;
ngx_pool_cleanup_t *next;
};
typedef struct ngx_pool_large_s ngx_pool_large_t;
struct ngx_pool_large_s {
ngx_pool_large_t *next;
void *alloc;
};
typedef struct {
u_char *last;
u_char *end;
ngx_pool_t *next;
ngx_uint_t failed;
} ngx_pool_data_t;
struct ngx_pool_s {
ngx_pool_data_t d;
size_t max;
ngx_pool_t *current;
ngx_chain_t *chain;
ngx_pool_large_t *large;
ngx_pool_cleanup_t *cleanup;
ngx_log_t *log;
};
最新文章
- AngularJS基础入门初探
- 【原】迎接微信winphone 5.0 版本的IE10样式兼容
- 桌面 透明 三角形 分层窗口 DX
- ELK——在 CentOS/Linux 把 Kibana 3.0 部署在 Nginx 1.9.12
- android 事件处理概念簇
- NGif, Animated GIF Encoder for .NET
- ADO.net 扩展属性
- tmpfs
- java 切换
- cobbler部署
- HDU-1874 畅通工程续 (最短路径启蒙题)
- 关于java的环境变量的一点总结
- 遇到scan configurtation CDT builder等的错误
- SQL Server信息偏差影响表联结方式统计
- LeetCode(99):恢复二叉搜索树
- [leetcode]46. Permutations全排列(给定序列无重复元素)
- selenium捕捉视频
- 报错libtest: error while loading shared libraries: libuv.so.1: cannot open shared object file: No such file or directory
- django模板系统(上)
- css之-webkit-scrollbar