【发布时间】:2013-10-24 00:25:28
【问题描述】:
R16B02 erl_db.c:1272
/* we create table outside any table lock
* and take the unusal cost of destroy table if it
* fails to find a slot
*/
{
DbTable init_tb;
erts_smp_atomic_init_nob(&init_tb.common.memory_size, 0);
tb = (DbTable*) erts_db_alloc(ERTS_ALC_T_DB_TABLE,
&init_tb, sizeof(DbTable));
erts_smp_atomic_init_nob(&tb->common.memory_size,
erts_smp_atomic_read_nob(&init_tb.common.memory_size));
}
我的问题。为什么这样做? init_tb 只使用 common.memory_size 字段。为什么不使用 int 替换?
【问题讨论】: