<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi<br>
    <br>
    We have done a major rework in this area. (Check the master branch
    on github for specifics).<br>
    I will try to merge this into maint, as the other changes will (most
    likely) not take effect until R16.<br>
    If there are tests failing and/or other complications this patch
    might not make it to maint.<br>
    <br>
    Thank you for the contribution!<br>
    <br>
    <br>
    On 01/16/2012 03:21 PM, Tobias Schlager wrote:
    <blockquote
      cite="mid:12F2115FD1CCEE4294943B2608A18FA3EAB27A@MAIL01.win.lbaum.eu"
      type="cite">
      <pre wrap="">This patch extends the specs for the following built-in functions:
* process_flag/2,3
* system_flag/2
* system_info/1
* spawn_opt/2,3,4

The main intention for this patch was to make dialyzer recognize the process_flag option 'sensitive'. When fixing this issue I noticed some more missing specs and added what I could find in the latest documentation.

Regards
Tobias


>From 2d57bd2fe55573e48c035cc0e1ecc94617263630 Mon Sep 17 00:00:00 2001
From: Tobias Schlager <a class="moz-txt-link-rfc2396E" href="mailto:tobias.schlager@lindenbaum.eu"><tobias.schlager@lindenbaum.eu></a>
Date: Mon, 16 Jan 2012 14:29:01 +0100
Subject: [PATCH] extended specs for built-in functions

---
 lib/hipe/cerl/erl_bif_types.erl |   48 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl
index cee399e..88058ae 100644
--- a/lib/hipe/cerl/erl_bif_types.erl
+++ b/lib/hipe/cerl/erl_bif_types.erl
@@ -1202,11 +1202,13 @@ type(erlang, process_flag, 2, Xs) ->
                 case t_atom_vals(Flag) of
                   ['error_handler'] -> t_atom();
                   ['min_heap_size'] -> t_non_neg_integer();
+                   ['min_bin_vheap_size'] -> t_non_neg_integer();
                   ['scheduler'] -> t_non_neg_integer();
                   ['monitor_nodes'] -> t_boolean();
                   ['priority'] -> t_process_priority_level();
                   ['save_calls'] -> t_non_neg_integer();
                   ['trap_exit'] -> t_boolean();
+                   ['sensitive'] -> t_boolean();
                   List when is_list(List) ->
                     T_process_flag_returns;
                   unknown ->
@@ -1503,6 +1505,8 @@ type(erlang, system_flag, 2, Xs) ->
                     t_non_neg_fixnum();
                   ['min_heap_size'] ->
                     t_non_neg_fixnum();
+                  ['min_bin_vheap_size'] ->
+                    t_non_neg_fixnum();
                   ['multi_scheduling'] ->
                     t_system_multi_scheduling();
                   ['schedulers_online'] ->
@@ -1546,8 +1550,12 @@ type(erlang, system_info, 1, Xs) ->
                              t_list(t_tuple([t_atom(),
                                              t_list(t_tuple([t_atom(),
                                                              t_any()]))]))]);
+                  ['build_type'] ->
+                     t_system_build_type_return();
                   ['break_ignored'] ->
                     t_boolean();
+                   ['c_compiler_used'] ->
+                     t_tuple([t_atom(), t_any()]);
                   ['cpu_topology'] ->
                     t_system_cpu_topology();
                   ['compat_rel'] ->
@@ -1560,6 +1568,8 @@ type(erlang, system_info, 1, Xs) ->
                     t_binary();
                   ['dist_ctrl'] ->
                     t_list(t_tuple([t_atom(), t_sup([t_pid(), t_port])]));
+                   ['driver_version'] ->
+                     t_string();
                   %% elib_malloc is intentionally not included,
                   %% because it scheduled for removal in R15.
                   ['endian'] ->
@@ -1573,7 +1583,9 @@ type(erlang, system_info, 1, Xs) ->
                   ['heap_sizes'] ->
                     t_list(t_integer());
                   ['heap_type'] ->
-                    t_sup([t_atom('private'), t_atom('hybrid')]);
+                    t_sup([t_atom('private'),
+                            t_atom('shared'),
+                            t_atom('hybrid')]);
                   ['hipe_architecture'] ->
                     t_atoms(['amd64', 'arm', 'powerpc', 'ppc64',
                              'undefined', 'ultrasparc', 'x86']);
@@ -1581,12 +1593,20 @@ type(erlang, system_info, 1, Xs) ->
                     t_binary();
                   ['internal_cpu_topology'] -> %% Undocumented internal feature
                     t_internal_cpu_topology();
+                   ['kernel_poll'] ->
+                     t_boolean();
                   ['loaded'] ->
                     t_binary();
                   ['logical_processors'] ->
                     t_non_neg_fixnum();
                   ['machine'] ->
                     t_string();
+                   ['min_heap_size'] ->
+                     t_tuple([t_atom('min_heap_size'),
+                              t_non_neg_integer()]);
+                   ['min_bin_vheap_size'] ->
+                     t_tuple([t_atom('min_bin_vheap_size'),
+                              t_non_neg_integer()]);
                   ['multi_scheduling'] ->
                     t_system_multi_scheduling();
                   ['multi_scheduling_blockers'] ->
@@ -1601,6 +1621,8 @@ type(erlang, system_info, 1, Xs) ->
                                    t_non_neg_fixnum(),
                                    t_non_neg_fixnum()]),
                           t_string());
+                   ['otp_release'] ->
+                     t_string();
                   ['process_count'] ->
                     t_non_neg_fixnum();
                   ['process_limit'] ->
@@ -1630,6 +1652,8 @@ type(erlang, system_info, 1, Xs) ->
                     t_non_neg_fixnum();
                   ['trace_control_word'] ->
                     t_integer();
+                   ['update_cpu_info'] ->
+                     t_sup([t_atom('changed'), t_atom('unchanged')]);
                   ['version'] ->
                     t_string();
                   ['wordsize'] ->
@@ -3747,8 +3771,13 @@ arg_types(erlang, pre_loaded, 0) ->
 arg_types(erlang, process_display, 2) ->
   [t_pid(), t_atom('backtrace')];
 arg_types(erlang, process_flag, 2) ->
-  [t_sup([t_atom('trap_exit'), t_atom('error_handler'),
-         t_atom('min_heap_size'), t_atom('priority'), t_atom('save_calls'),
+  [t_sup([t_atom('trap_exit'),
+          t_atom('error_handler'),
+         t_atom('min_heap_size'),
+          t_atom('min_bin_vheap_size'),
+          t_atom('priority'),
+          t_atom('save_calls'),
+          t_atom('sensitive'),
          t_atom('scheduler'),                             % undocumented
          t_atom('monitor_nodes'),                        % undocumented
          t_tuple([t_atom('monitor_nodes'), t_list()])]), % undocumented
@@ -3861,6 +3890,7 @@ arg_types(erlang, system_flag, 2) ->
          t_atom('display_items'),      % undocumented
          t_atom('fullsweep_after'),
          t_atom('min_heap_size'),
+         t_atom('min_bin_vheap_size'),
          t_atom('multi_scheduling'),
          t_atom('schedulers_online'),
          t_atom('scheduler_bind_type'),
@@ -4733,6 +4763,7 @@ t_spawn_options() ->
         t_atom('monitor'),
         t_tuple([t_atom('priority'), t_process_priority_level()]),
         t_tuple([t_atom('min_heap_size'), t_fixnum()]),
+        t_tuple([t_atom('min_bin_vheap_size'), t_fixnum()]),
         t_tuple([t_atom('fullsweep_after'), t_fixnum()])]).

 t_spawn_opt_return(List) ->
@@ -4821,6 +4852,17 @@ t_system_profile_return() ->
   t_sup(t_atom('undefined'),
        t_tuple([t_sup(t_pid(), t_port()), t_system_profile_options()])).

+t_system_build_type_return() ->
+  t_sup([t_atom('opt'),
+         t_atom('debug'),
+         t_atom('purify'),
+         t_atom('quantify'),
+         t_atom('purecov'),
+         t_atom('gcov'),
+         t_atom('valgrind'),
+         t_atom('gprof'),
+         t_atom('lcnt')]).
+
 %% =====================================================================
 %% These are used for the built-in functions of 'ets'
 %% =====================================================================
--
1.7.7.5

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
erlang-patches mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-patches@erlang.org">erlang-patches@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-patches">http://erlang.org/mailman/listinfo/erlang-patches</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
/Henrik Nord Erlang/OTP</pre>
  </body>
</html>