(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得到的,属于动态分配。
1222

被折叠的 条评论
为什么被折叠?



