aboutsummaryrefslogtreecommitdiffstats
path: root/system/doc
diff options
context:
space:
mode:
Diffstat (limited to 'system/doc')
-rw-r--r--system/doc/design_principles/events.xml19
-rw-r--r--system/doc/design_principles/fsm.xml7
-rw-r--r--system/doc/design_principles/gen_server_concepts.xml7
-rw-r--r--system/doc/efficiency_guide/advanced.xml6
-rw-r--r--system/doc/efficiency_guide/appendix.xml2
-rw-r--r--system/doc/efficiency_guide/binaryhandling.xml8
-rw-r--r--system/doc/efficiency_guide/drivers.xml2
-rw-r--r--system/doc/efficiency_guide/functions.xml2
-rw-r--r--system/doc/efficiency_guide/myths.xml2
-rw-r--r--system/doc/efficiency_guide/processes.xml8
-rw-r--r--system/doc/efficiency_guide/profiling.xml16
-rw-r--r--system/doc/efficiency_guide/tablesDatabases.xml6
-rw-r--r--system/doc/embedded/intro.xml2
-rw-r--r--system/doc/embedded/vme_problems.xml2
-rw-r--r--system/doc/embedded/xntp.xml2
-rw-r--r--system/doc/reference_manual/errors.xml12
-rw-r--r--system/doc/reference_manual/expressions.xml4
-rw-r--r--system/doc/top/src/erl_html_tools.erl14
-rw-r--r--system/doc/tutorial/c_port.xmlsrc2
-rw-r--r--system/doc/tutorial/nif.xmlsrc2
20 files changed, 75 insertions, 50 deletions
diff --git a/system/doc/design_principles/events.xml b/system/doc/design_principles/events.xml
index 5579f1e459..23a9b8c7bc 100644
--- a/system/doc/design_principles/events.xml
+++ b/system/doc/design_principles/events.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -217,5 +217,22 @@ terminate(_Args, Fd) ->
ok</pre>
</section>
</section>
+ <section>
+ <title>Handling Other Messages</title>
+ <p>If the gen_event should be able to receive other messages than
+ events, the callback function <c>handle_info(Info, StateName, StateData)</c>
+ must be implemented to handle them. Examples of
+ other messages are exit messages, if the gen_event is linked to
+ other processes (than the supervisor) and trapping exit signals.</p>
+ <code type="none">
+handle_info({'EXIT', Pid, Reason}, State) ->
+ ..code to handle exits here..
+ {ok, NewState}.</code>
+ <p>The code_change method also has to be implemented.</p>
+ <code type="none">
+code_change(OldVsn, State, Extra) ->
+ ..code to convert state (and more) during code change
+ {ok, NewState}</code>
+ </section>
</chapter>
diff --git a/system/doc/design_principles/fsm.xml b/system/doc/design_principles/fsm.xml
index 7cdd62057b..edb2e20605 100644
--- a/system/doc/design_principles/fsm.xml
+++ b/system/doc/design_principles/fsm.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -308,6 +308,11 @@ terminate(normal, _StateName, _StateData) ->
handle_info({'EXIT', Pid, Reason}, StateName, StateData) ->
..code to handle exits here..
{next_state, StateName1, StateData1}.</code>
+ <p>The code_change method also has to be implemented.</p>
+ <code type="none">
+code_change(OldVsn, StateName, StateData, Extra) ->
+ ..code to convert state (and more) during code change
+ {ok, NextStateName, NewStateData}</code>
</section>
</chapter>
diff --git a/system/doc/design_principles/gen_server_concepts.xml b/system/doc/design_principles/gen_server_concepts.xml
index 8131c47a69..a904390999 100644
--- a/system/doc/design_principles/gen_server_concepts.xml
+++ b/system/doc/design_principles/gen_server_concepts.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -264,6 +264,11 @@ terminate(normal, State) ->
handle_info({'EXIT', Pid, Reason}, State) ->
..code to handle exits here..
{noreply, State1}.</code>
+ <p>The code_change method also has to be implemented.</p>
+ <code type="none">
+code_change(OldVsn, State, Extra) ->
+ ..code to convert state (and more) during code change
+ {ok, NewState}.</code>
</section>
</chapter>
diff --git a/system/doc/efficiency_guide/advanced.xml b/system/doc/efficiency_guide/advanced.xml
index 2383e3cf3d..821175bb09 100644
--- a/system/doc/efficiency_guide/advanced.xml
+++ b/system/doc/efficiency_guide/advanced.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2001</year><year>2010</year>
+ <year>2001</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -34,7 +34,7 @@
<p>A good start when programming efficiently is to have knowledge about
how much memory different data types and operations require. It is
implementation-dependent how much memory the Erlang data types and
- other items consume, but here are some figures for
+ other items consume, but here are some figures for the
erts-5.2 system (OTP release R9B). (There have been no significant
changes in R13.)</p>
@@ -200,7 +200,7 @@ On 64-bit architectures: 4 words for a reference from the current local node, an
<seealso marker="#ports">the maximum number of Erlang ports</seealso>
available, and operating system specific settings and limits.</item>
<tag><em>Number of arguments to a function or fun</em></tag>
- <item>256</item>
+ <item>255</item>
</taglist>
</section>
</chapter>
diff --git a/system/doc/efficiency_guide/appendix.xml b/system/doc/efficiency_guide/appendix.xml
index 631ef9bee7..6eaaeffbc4 100644
--- a/system/doc/efficiency_guide/appendix.xml
+++ b/system/doc/efficiency_guide/appendix.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2002</year>
- <year>2007</year>
+ <year>2011</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/binaryhandling.xml b/system/doc/efficiency_guide/binaryhandling.xml
index 8746de4b60..425d6308cf 100644
--- a/system/doc/efficiency_guide/binaryhandling.xml
+++ b/system/doc/efficiency_guide/binaryhandling.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2007</year>
+ <year>2011</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -114,7 +114,7 @@ my_binary_to_list(<<>>) -> [].]]></code>
data. For each field that is matched out of a binary, the position in the
match context will be incremented.</p>
- <p>In R11B, a match context was only using during a binary matching
+ <p>In R11B, a match context was only used during a binary matching
operation.</p>
<p>In R12B, the compiler tries to avoid generating code that
@@ -205,7 +205,7 @@ Bin4 = <<Bin1/binary,17>>, %% 5 !!!
ProcBin for the binary. The reason is that the binary object can be
moved (reallocated) during an append operation, and when that happens
the pointer in the ProcBin must be updated. If there would be more than
- on ProcBin pointing to the binary object, it would not be possible to
+ one ProcBin pointing to the binary object, it would not be possible to
find and update all of them.</p>
<p>Therefore, certain operations on a binary will mark it so that
@@ -291,7 +291,7 @@ my_binary_to_list(<<>>) -> [].]]></code>
that initializes the matching operation will basically do nothing
when it sees that it was passed a match context instead of a binary.</p>
- <p>When the end of the binary is reached and second clause matches,
+ <p>When the end of the binary is reached and the second clause matches,
the match context will simply be discarded (removed in the next
garbage collection, since there is no longer any reference to it).</p>
diff --git a/system/doc/efficiency_guide/drivers.xml b/system/doc/efficiency_guide/drivers.xml
index 9fe54fb19a..1967fd7ada 100644
--- a/system/doc/efficiency_guide/drivers.xml
+++ b/system/doc/efficiency_guide/drivers.xml
@@ -40,7 +40,7 @@
any code in a driver.</p>
<p>By default, that lock will be at the driver level, meaning that
- if several ports has been opened to the same driver, only code for
+ if several ports have been opened to the same driver, only code for
one port at the same time can be running.</p>
<p>A driver can be configured to instead have one lock for each port.</p>
diff --git a/system/doc/efficiency_guide/functions.xml b/system/doc/efficiency_guide/functions.xml
index fe14a4f000..6be49dd7c9 100644
--- a/system/doc/efficiency_guide/functions.xml
+++ b/system/doc/efficiency_guide/functions.xml
@@ -127,7 +127,7 @@ map_pairs2(_Map, [_|_]=Xs, [] ) ->
map_pairs2(Map, [X|Xs], [Y|Ys]) ->
[Map(X, Y)|map_pairs2(Map, Xs, Ys)].]]></code>
- <p>the compiler is free rearrange the clauses. It will generate code
+ <p>the compiler is free to rearrange the clauses. It will generate code
similar to this</p>
<p><em>DO NOT (already done by the compiler)</em></p>
diff --git a/system/doc/efficiency_guide/myths.xml b/system/doc/efficiency_guide/myths.xml
index 65113c9372..6fdeb5c4f9 100644
--- a/system/doc/efficiency_guide/myths.xml
+++ b/system/doc/efficiency_guide/myths.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2007</year>
+ <year>2011</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/efficiency_guide/processes.xml b/system/doc/efficiency_guide/processes.xml
index a25ec53370..b75be7d531 100644
--- a/system/doc/efficiency_guide/processes.xml
+++ b/system/doc/efficiency_guide/processes.xml
@@ -105,7 +105,7 @@ loop() ->
<seealso marker="erts:erlang#spawn_opt/4">spawn_opt/4</seealso>.</p>
<p>The gain is twofold: Firstly, although the garbage collector will
- grow the heap, it will it grow it step by step, which will be more
+ grow the heap, it will grow it step by step, which will be more
costly than directly establishing a larger heap when the process
is spawned. Secondly, the garbage collector may also shrink the
heap if it is much larger than the amount of data stored on it;
@@ -172,7 +172,7 @@ days_in_month(M) ->
<p>Shared sub-terms are <em>not</em> preserved when a term is sent
to another process, passed as the initial process arguments in
the <c>spawn</c> call, or stored in an ETS table.
- That is an optimization. Most applications do not send message
+ That is an optimization. Most applications do not send messages
with shared sub-terms.</p>
<p>Here is an example of how a shared sub-term can be created:</p>
@@ -237,8 +237,8 @@ true
<section>
<title>The SMP emulator</title>
- <p>The SMP emulator (introduced in R11B) will take advantage of
- multi-core or multi-CPU computer by running several Erlang schedulers
+ <p>The SMP emulator (introduced in R11B) will take advantage of a
+ multi-core or multi-CPU computer by running several Erlang scheduler
threads (typically, the same as the number of cores). Each scheduler
thread schedules Erlang processes in the same way as the Erlang scheduler
in the non-SMP emulator.</p>
diff --git a/system/doc/efficiency_guide/profiling.xml b/system/doc/efficiency_guide/profiling.xml
index 65d13408bc..8be1c7175d 100644
--- a/system/doc/efficiency_guide/profiling.xml
+++ b/system/doc/efficiency_guide/profiling.xml
@@ -74,7 +74,7 @@
<title>What to look for</title>
<p>When analyzing the result file from the profiling activity
you should look for functions that are called many
- times and have a long "own" execution time (time excluded calls
+ times and have a long "own" execution time (time excluding calls
to other functions). Functions that just are called very
many times can also be interesting, as even small things can add
up to quite a bit if they are repeated often. Then you need to
@@ -87,7 +87,7 @@
<item>Are there redundant tests that can be removed? </item>
<item>Is there some expression calculated giving the same result
each time? </item>
- <item>Is there other ways of doing this that are equivalent and
+ <item>Are there other ways of doing this that are equivalent and
more efficient?</item>
<item>Can I use another internal data representation to make
things more efficient? </item>
@@ -138,7 +138,7 @@
<p><c>cprof</c> is something in between <c>fprof</c> and
<c>cover</c> regarding features. It counts how many times each
function is called when the program is run, on a per module
- basis. <c>cprof</c> has a low performance degradation (versus
+ basis. <c>cprof</c> has a low performance degradation effect (versus
<c>fprof</c> and <c>eprof</c>) and does not need to recompile
any modules to profile (versus <c>cover</c>).</p>
</section>
@@ -231,7 +231,7 @@
consistent from run to run. The disadvantage is that the time
spent in the operating system kernel (such as swapping and I/O)
are not included. Therefore, measuring CPU time is misleading if
- any I/O (file or sockets) are involved.</p>
+ any I/O (file or socket) is involved.</p>
<p>It is probably a good idea to do both wall-clock measurements and
CPU time measurements.</p>
@@ -239,18 +239,18 @@
<p>Some additional advice:</p>
<list type="bulleted">
- <item>The granularity of both types measurement could be quite
+ <item>The granularity of both types of measurement could be quite
high so you should make sure that each individual measurement
lasts for at least several seconds.</item>
<item>To make the test fair, each new test run should run in its own,
- newly created Erlang process. Otherwise, if all tests runs in the
+ newly created Erlang process. Otherwise, if all tests run in the
same process, the later tests would start out with larger heap sizes
- and therefore probably does less garbage collections. You could
+ and therefore probably do less garbage collections. You could
also consider restarting the Erlang emulator between each test.</item>
<item>Do not assume that the fastest implementation of a given algorithm
- on computer architecture X also is the fast on computer architecture Y.</item>
+ on computer architecture X also is the fastest on computer architecture Y.</item>
</list>
</section>
diff --git a/system/doc/efficiency_guide/tablesDatabases.xml b/system/doc/efficiency_guide/tablesDatabases.xml
index 4b53348c4c..2f5103a08b 100644
--- a/system/doc/efficiency_guide/tablesDatabases.xml
+++ b/system/doc/efficiency_guide/tablesDatabases.xml
@@ -280,9 +280,9 @@ lists:filter(fun(X) -> X#person.name == "Bryan" end, TabList),
<p>A simple solution would be to use the <c>name</c> field as
the key instead of the <c>idno</c> field, but that would cause
problems if the names were not unique. A more general solution
- would be create a second table with name as key and idno as
- data, i.e. to index (invert) the table with regards to the
- <c>name</c> field. The second table would of course have to be
+ would be to create a second table with <c>name</c> as key and
+ <c>idno</c> as data, i.e. to index (invert) the table with regards
+ to the <c>name</c> field. The second table would of course have to be
kept consistent with the master table. Mnesia could do this
for you, but a home brew index table could be very efficient
compared to the overhead involved in using Mnesia.</p>
diff --git a/system/doc/embedded/intro.xml b/system/doc/embedded/intro.xml
index 3eafffd6fa..545500c9c9 100644
--- a/system/doc/embedded/intro.xml
+++ b/system/doc/embedded/intro.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2007</year>
+ <year>2011</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/embedded/vme_problems.xml b/system/doc/embedded/vme_problems.xml
index 7f9b929875..03a70bae3b 100644
--- a/system/doc/embedded/vme_problems.xml
+++ b/system/doc/embedded/vme_problems.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2007</year>
+ <year>2011</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/embedded/xntp.xml b/system/doc/embedded/xntp.xml
index 564b63fc7d..270d986cf1 100644
--- a/system/doc/embedded/xntp.xml
+++ b/system/doc/embedded/xntp.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2007</year>
+ <year>2011</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/reference_manual/errors.xml b/system/doc/reference_manual/errors.xml
index 02885a3813..4e207021d3 100644
--- a/system/doc/reference_manual/errors.xml
+++ b/system/doc/reference_manual/errors.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2009</year>
+ <year>2003</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -48,10 +48,8 @@
The Erlang programming language has built-in features for
handling of run-time errors.</p>
<p>A run-time error can also be emulated by calling
- <c>erlang:error(Reason)</c>, <c>erlang:error(Reason, Args)</c>
- (those appeared in Erlang 5.4/OTP-R10),
- <c>erlang:fault(Reason)</c> or <c>erlang:fault(Reason, Args)</c>
- (old equivalents).</p>
+ <c>erlang:error(Reason)</c> or <c>erlang:error(Reason, Args)</c>
+ (those appeared in Erlang 5.4/OTP-R10).</p>
<p>A run-time error is another name for an exception
of class <c>error</c>.
</p>
@@ -91,7 +89,7 @@
</row>
<row>
<cell align="left" valign="middle"><c>error</c></cell>
- <cell align="left" valign="middle">Run-time error for example <c>1+a</c>, or the process called <c>erlang:error/1,2</c> (appeared in Erlang 5.4/OTP-R10B) or <c>erlang:fault/1,2</c> (old equivalent)</cell>
+ <cell align="left" valign="middle">Run-time error for example <c>1+a</c>, or the process called <c>erlang:error/1,2</c> (appeared in Erlang 5.4/OTP-R10B)</cell>
</row>
<row>
<cell align="left" valign="middle"><c>exit</c></cell>
@@ -108,7 +106,7 @@
and a stack trace (that aids in finding the code location of
the exception).</p>
<p>The stack trace can be retrieved using
- <c>erlang:get_stacktrace/0</c> (new in Erlang 5.4/OTP-R10B
+ <c>erlang:get_stacktrace/0</c> (new in Erlang 5.4/OTP-R10B)
from within a <c>try</c> expression, and is returned for
exceptions of class <c>error</c> from a <c>catch</c> expression.</p>
<p>An exception of class <c>error</c> is also known as a run-time
diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml
index 714ecccaf6..497d7eb464 100644
--- a/system/doc/reference_manual/expressions.xml
+++ b/system/doc/reference_manual/expressions.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2003</year><year>2010</year>
+ <year>2003</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -269,7 +269,7 @@ fun lists:append/2([1,2], [3,4])
set of auto-imported BIFs does not silently change the behavior
of old code.</p>
- <p>However, to avoid that old (pre R14) code changed it's
+ <p>However, to avoid that old (pre R14) code changed its
behavior when compiled with OTP version R14A or later, the
following restriction applies: If you override the name of a BIF
that was auto-imported in OTP versions prior to R14A (ERTS version
diff --git a/system/doc/top/src/erl_html_tools.erl b/system/doc/top/src/erl_html_tools.erl
index 599268804e..bb6a9a9f0a 100644
--- a/system/doc/top/src/erl_html_tools.erl
+++ b/system/doc/top/src/erl_html_tools.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -134,10 +134,10 @@ subst_file(Group, OutFile, Template, Info) ->
file:write(Stream, Text),
file:close(Stream);
Error ->
- error("Can't write to file ~s: ~w", [OutFile,Error])
+ local_error("Can't write to file ~s: ~w", [OutFile,Error])
end;
Error ->
- error("Can't write to file ~s: ~w", [OutFile,Error])
+ local_error("Can't write to file ~s: ~w", [OutFile,Error])
end.
@@ -156,7 +156,7 @@ find_templates([SearchPath | SearchPaths], AllSearchPaths) ->
Result
end;
find_templates([], AllSearchPaths) ->
- error("No templates found in ~p",[AllSearchPaths]).
+ local_error("No templates found in ~p",[AllSearchPaths]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -269,7 +269,7 @@ find_application_infos([{App, Vsn, AppPath, IndexURL} | Paths]) ->
string:substr(G0,N+1)}
end;
false ->
- error("No group given",[])
+ local_error("No group given",[])
end,
Text =
case lists:keysearch("short", 1, Db) of
@@ -427,7 +427,7 @@ subst_applinks_1([{G, Heading}|Gs], Info0, Group) ->
end;
subst_applinks_1([], [], _) -> [];
subst_applinks_1([], Info, _) ->
- error("Info left: ~p\n", [Info]),
+ local_error("Info left: ~p\n", [Info]),
[].
html_applinks([{Name,[{_,_,URL,_}|_]}|AppNames]) ->
@@ -669,7 +669,7 @@ sub_repl([], _Fun, Acc, S, Pos) -> {string:substr(S, Pos+1), Acc}.
% Error and warnings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-error(Format, Args) ->
+local_error(Format, Args) ->
io:format("ERROR: " ++ Format ++ "\n", Args),
exit(1).
diff --git a/system/doc/tutorial/c_port.xmlsrc b/system/doc/tutorial/c_port.xmlsrc
index b4caa07578..b139fe0678 100644
--- a/system/doc/tutorial/c_port.xmlsrc
+++ b/system/doc/tutorial/c_port.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2009</year>
+ <year>2000</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/system/doc/tutorial/nif.xmlsrc b/system/doc/tutorial/nif.xmlsrc
index f9197c69dd..6cb54ff7ff 100644
--- a/system/doc/tutorial/nif.xmlsrc
+++ b/system/doc/tutorial/nif.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2009</year>
+ <year>2000</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>