cycle 之配置不变

(gdb) p *cycle
$6 = {
  conf_ctx = 0x6964a0, 
  pool = 0x6956c0, 
  log = 0x695728, 
  new_log = {
    log_level = 4, 
    file = 0x695998, 
    connection = 0, 
    handler = 0x0, 
    data = 0x0, 
    action = 0x0
  }, 
  files = 0x0, 
  free_connections = 0x0, 
  free_connection_n = 0, 
  reusable_connections_queue = {
    prev = 0x695770, 
    next = 0x695770
  }, 
  listening = {
    elts = 0x695d70, 
    nelts = 1, 
    size = 184, 

    nalloc = 10, 
    pool = 0x6956c0
  }, 
  pathes = {
    elts = 0x695918, 
    nelts = 5, 
    size = 8, 
    nalloc = 10, 
    pool = 0x6956c0
  }, 
  open_files = {
    last = 0x6957d8, 
    part = {
      elts = 0x695968, 
      nelts = 2, 
      next = 0x0
    }, 
    size = 48, 
    nalloc = 20, 
    pool = 0x6956c0
  }, 
  shared_memory = {
    last = 0x695810, 

    part = {
      elts = 0x695d28, 
      nelts = 0, 
      next = 0x0
    }, 
    size = 72, 
    nalloc = 1, 
    pool = 0x6956c0
  }, 
  connection_n = 1024, 
  files_n = 0, 
  connections = 0x0, 
  read_events = 0x0, 
  write_events = 0x0, 
  old_cycle = 0x0, 
  conf_file = {
    len = 32, 
    data = 0x6958f7 "/usr/local/nginx/conf/nginx.conf"
  }, 
  conf_param = {
    len = 0, 
    data = 0x695918 "\320\343j"
  }, 
---Type <return> to continue, or q <return> to quit---
  conf_prefix = {
    len = 22, 
    data = 0x6958d0 "/usr/local/nginx/conf//usr/local/nginx//usr/local/nginx/conf/nginx.conf"
  }, 
  prefix = {
    len = 17, 
    data = 0x6958e6 "/usr/local/nginx//usr/local/nginx/conf/nginx.conf"
  }, 
  lock_file = {
    len = 33, 
    data = 0x6b1a20 "/usr/local/nginx/logs/nginx.lock.accept"
  }, 
  hostname = {
    len = 3, 
    data = 0x6965f8 "×××l"
  }
}

再来重新加载一次。

(gdb) set print pretty on
(gdb) p * cycle
$2 = {
  conf_ctx = 0x6964a0, 
  pool = 0x6956c0, 
  log = 0x695728, 
  new_log = {
    log_level = 4, 
    file = 0x695998, 
    connection = 0, 
    handler = 0x0, 
    data = 0x0, 
    action = 0x0
  }, 
  files = 0x0, 
  free_connections = 0x0, 
  free_connection_n = 0, 
  reusable_connections_queue = {
    prev = 0x695770, 
    next = 0x695770
  }, 
  listening = {
    elts = 0x695d70, 
    nelts = 1, 
    size = 184, 
---Type <return> to continue, or q <return> to quit---
    nalloc = 10, 
    pool = 0x6956c0
  }, 
  pathes = {
    elts = 0x695918, 
    nelts = 5, 
    size = 8, 
    nalloc = 10, 
    pool = 0x6956c0
  }, 
  open_files = {
    last = 0x6957d8, 
    part = {
      elts = 0x695968, 
      nelts = 2, 
      next = 0x0
    }, 
    size = 48, 
    nalloc = 20, 
    pool = 0x6956c0
  }, 
  shared_memory = {
    last = 0x695810, 

    part = {
      elts = 0x695d28, 
      nelts = 0, 
      next = 0x0
    }, 
    size = 72, 
    nalloc = 1, 
    pool = 0x6956c0
  }, 
  connection_n = 1024, 
  files_n = 0, 
  connections = 0x0, 
  read_events = 0x0, 
  write_events = 0x0, 
  old_cycle = 0x0, 
  conf_file = {
    len = 32, 
    data = 0x6958f7 "/usr/local/nginx/conf/nginx.conf"
  }, 
  conf_param = {
    len = 0, 
    data = 0x695918 "\320\343j"
  }, 

  conf_prefix = {
    len = 22, 
    data = 0x6958d0 "/usr/local/nginx/conf//usr/local/nginx//usr/local/nginx/conf/nginx.conf"
  }, 
  prefix = {
    len = 17, 
    data = 0x6958e6 "/usr/local/nginx//usr/local/nginx/conf/nginx.conf"
  }, 
  lock_file = {
    len = 33, 
    data = 0x6b1a20 "/usr/local/nginx/logs/nginx.lock.accept"
  }, 
  hostname = {
    len = 3, 
    data = 0x6965f8 "×××"
  }
}
也就是说,不管什么时候运行,cycle的配置都是保持不变的。这一点是很值得研究的;因为配置中的很多都是malloc得到的,属于动态分配。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值