From 67dd153f6aff8dab6dc8d938664696675b152c20 Mon Sep 17 00:00:00 2001 From: Jesper Louis Andersen Date: Thu, 16 Dec 2010 03:33:10 +0100 Subject: Fix type specification of the ets:new/2 BIF The options for the ets:new/2 call has changed recently. There are read_concurrency hints as well as compressed tables. The hipe/dialyzer did not take this into account. This patch corrects the problem by going through the documentation and altering the type specification. The error fixed is with the dialyzer. When constructing an ETS table with, e.g., {read_concurrency, true}, the dialyzer will report that the caller of ets:new/2 will not return. ; First, we update the documentation from the ets man page. ; Second, we reorder the type specification of keypos so they appear in the same order as in the documentation. ; Finally, we add the missing read_concurrency and compressed Tweak options. --- lib/hipe/cerl/erl_bif_types.erl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/hipe') diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index ed5bf03804..9bddcc980f 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -4940,10 +4940,11 @@ t_matchres() -> %% From the 'ets' documentation %%----------------------------- %% Option = Type | Access | named_table | {keypos,Pos} -%% | {heir,pid(),HeirData} | {heir,none} -%% | {write_concurrency,boolean()} +%% | {heir,pid(),HeirData} | {heir,none} | Tweaks %% Type = set | ordered_set | bag | duplicate_bag %% Access = public | protected | private +%% Tweaks = {write_concurrency,boolean()} +%% | {read_concurrency,boolean()} | compressed %% Pos = integer() %% HeirData = term() t_ets_new_options() -> @@ -4955,10 +4956,12 @@ t_ets_new_options() -> t_atom('protected'), t_atom('private'), t_atom('named_table'), + t_tuple([t_atom('keypos'), t_integer()]), t_tuple([t_atom('heir'), t_pid(), t_any()]), t_tuple([t_atom('heir'), t_atom('none')]), - t_tuple([t_atom('keypos'), t_integer()]), - t_tuple([t_atom('write_concurrency'), t_boolean()])])). + t_tuple([t_atom('write_concurrency'), t_boolean()]), + t_tuple([t_atom('read_concurrency'), t_boolean()]), + t_atom('compressed')])). t_ets_info_items() -> t_sup([t_atom('fixed'), -- cgit v1.2.3