dict:new/0
初始构造一个新的字典
用法:
new() -> dictionary()
内部实现:
%% Define a hashtable. The default values are the standard ones. -record(dict, {size=0 :: non_neg_integer(), % Number of elements n=?seg_size :: non_neg_integer(), % Number of active slots maxn=?seg_size :: non_neg_integer(), % Maximum slots bso=?seg_size div 2 :: non_neg_integer(), % Buddy slot offset exp_size=?exp_size :: non_neg_integer(), % Size to expand at con_size=?con_size :: non_neg_integer(), % Size to contract at empty :: tuple(), % Empty segment segs :: tuple() % Segments }). -spec new() -> dict(). new() -> Empty = mk_seg(?seg_size), #dict{empty=Empty,segs={Empty}}.
初始构造一个新的字典
dict:new().