Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngx_debug_pool: provide access to information of memory usage #638

Merged
merged 1 commit into from
Nov 25, 2015

Conversation

chobits
Copy link
Member

@chobits chobits commented Aug 22, 2015

@chobits chobits force-pushed the ngx_debug_pool branch 6 times, most recently from 78f978b to f067821 Compare August 25, 2015 13:02
ngx_uint_t i;
ngx_pool_stat_t *stat;

#define NGX_POOL_PID_SIZE (NGX_TIME_T_LEN + sizeof("pid:\n") - 1) /* sizeof pid_t equals time_t */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些宏有些可以用const来做
有些只用一次,可以去掉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不把1次性的宏写到计算size和sprintf里面,是使得下面的代码更加紧凑。
这里没必要用const,这里所有的宏都是为了简化下面代码(计算size和sprintf)和方便统一修改格式。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外没有把这些宏移到头部,是因为这些宏只在这个函数内起作用,并且放在size计算和sprintf逻辑之前也方便查看和改写

@cfsego
Copy link
Member

cfsego commented Nov 24, 2015

能够把ngx_palloc.*的两个文件全部移入模块目录,通过在config中的变换操作使编译使用我们提供的代码。
这样的好处是:

  1. 没有patch,以后好合并
  2. 可以选择接受或者不接受nginx的修改。
  3. 可以脱离tengine 跑

@chobits
Copy link
Member Author

chobits commented Nov 25, 2015

@cfsego
use modules/ngx_debug_pool/ngx_palloc.* instead of src/core/ngx_palloc.* if ngx_debug_pool modules is enabled.

@cfsego
Copy link
Member

cfsego commented Nov 25, 2015

LGTM

cfsego added a commit that referenced this pull request Nov 25, 2015
ngx_debug_pool: provide access to information of memory usage
@cfsego cfsego merged commit dd1289a into alibaba:master Nov 25, 2015
@cfsego cfsego added this to the 2.1.2 milestone Dec 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants