aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/doc/src/gen_statem.xml8
-rw-r--r--lib/stdlib/doc/src/proc_lib.xml7
-rw-r--r--lib/stdlib/src/proc_lib.erl5
3 files changed, 16 insertions, 4 deletions
diff --git a/lib/stdlib/doc/src/gen_statem.xml b/lib/stdlib/doc/src/gen_statem.xml
index b1d9799917..0e7d6e53e9 100644
--- a/lib/stdlib/doc/src/gen_statem.xml
+++ b/lib/stdlib/doc/src/gen_statem.xml
@@ -136,9 +136,9 @@ erlang:'!' -----> Module:StateName/3
is used as the state function name; see
<seealso marker="#Module:StateName/3"><c>Module:StateName/3</c></seealso>.
This gathers all code for a specific state
- in one function and hence dispatches on state first.
- Notice that in this mode
- the mandatory callback function
+ in one function as the <c>gen_statem</c> engine
+ branches depending on state name.
+ Notice that in this mode the mandatory callback function
<seealso marker="#Module:terminate/3"><c>Module:terminate/3</c></seealso>
makes the state name <c>terminate</c> unusable.
</p>
@@ -148,7 +148,7 @@ erlang:'!' -----> Module:StateName/3
is <c>handle_event_function</c>, the state can be any term
and the state function name is
<seealso marker="#Module:handle_event/4"><c>Module:handle_event/4</c></seealso>.
- This makes it easy to dispatch on state or on event as you desire.
+ This makes it easy to branch depending on state or event as you desire.
Be careful about which events you handle in which
states so that you do not accidentally postpone an event
forever creating an infinite busy loop.
diff --git a/lib/stdlib/doc/src/proc_lib.xml b/lib/stdlib/doc/src/proc_lib.xml
index 245580b1ba..f02b1f0651 100644
--- a/lib/stdlib/doc/src/proc_lib.xml
+++ b/lib/stdlib/doc/src/proc_lib.xml
@@ -73,6 +73,13 @@
<name name="priority_level"/>
</datatype>
<datatype>
+ <name name="max_heap_size"/>
+ <desc>
+ <p>See <seealso marker="erts:erlang#process_flag_max_heap_size">
+ erlang:process_flag(max_heap_size, MaxHeapSize)</seealso>.</p>
+ </desc>
+ </datatype>
+ <datatype>
<name name="dict_or_pid"/>
</datatype>
</datatypes>
diff --git a/lib/stdlib/src/proc_lib.erl b/lib/stdlib/src/proc_lib.erl
index fdc2ae4070..4a19603ec2 100644
--- a/lib/stdlib/src/proc_lib.erl
+++ b/lib/stdlib/src/proc_lib.erl
@@ -43,9 +43,14 @@
%%-----------------------------------------------------------------------------
-type priority_level() :: 'high' | 'low' | 'max' | 'normal'.
+-type max_heap_size() :: non_neg_integer() |
+ #{ size => non_neg_integer(),
+ kill => true,
+ error_logger => true}.
-type spawn_option() :: 'link'
| 'monitor'
| {'priority', priority_level()}
+ | {'max_heap_size', max_heap_size()}
| {'min_heap_size', non_neg_integer()}
| {'min_bin_vheap_size', non_neg_integer()}
| {'fullsweep_after', non_neg_integer()}