aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
AgeCommit message (Collapse)Author
2011-11-07EEP-23: Allow variables in fun M:F/ABjörn Gustavsson
Currently, the external fun syntax "fun M:F/A" only supports literals. That is, "fun lists:reverse/1" is allowed but not "fun M:F/A". In many real-life situations, some or all of M, F, A are not known until run-time, and one is forced to either use the undocumented erlang:make_fun/3 BIF or to use a "tuple fun" (which is deprecated). EEP-23 suggests that the parser (erl_parse) should immediately transform "fun M:F/A" to "erlang:make_fun(M, F, A)". We have not followed that approach in this implementation, because we want the abstract code to mirror the source code as closely as possible, and we also consider erlang:make_fun/3 to be an implementation detail that we might want to remove in the future. Instead, we will change the abstract format for "fun M:F/A" (in a way that is not backwards compatible), and while we are at it, we will move the translation from "fun M:F/A" to "erlang:make_fun(M, F, A)" from sys_pre_expand down to the v3_core pass. We will also update the debugger and xref to use the new format. We did consider making the abstract format backward compatible if no variables were used in the fun, but decided against it. Keeping it backward compatible would mean that there would be different abstract formats for the no-variable and variable case, and tools would have to handle both formats, probably forever. Reference: http://www.erlang.org/eeps/eep-0023.html
2011-10-27Remove unused */doc/src/make.dep filesBjörn Gustavsson
These dependency files was once used when building the documentation, but are no longer needed.
2011-10-21Fix a few tests that used to fail on the HiPE platformHans Bolinder
2011-10-20Merge branch 'rc/epp-include-path-fix'Henrik Nord
* rc/epp-include-path-fix: Make epp search directory of current file first when including another file OTP-9645
2011-10-20Merge branch 'hl/fix-ms_transform-scope-warn'Henrik Nord
* hl/fix-ms_transform-scope-warn: ms_transform: Fix incorrect `variable shadowed' warnings OTP-9646
2011-10-20Merge branch 'cf/simple_one_for_one_shutdown'Henrik Nord
* cf/simple_one_for_one_shutdown: Explain how dynamic child processes are stopped Stack errors when dynamic children are stopped Explicitly kill dynamic children in supervisors Conflicts: lib/stdlib/doc/src/supervisor.xml OTP-9647
2011-10-20Merge branch 'cf/supervisor_shutdown_infinity'Henrik Nord
* cf/supervisor_shutdown_infinity: Add a warning to docs about workers' shutdown strategy Allow an infinite timeout to shutdown worker processes OTP-9648
2011-10-20Merge branch 'bjorn/unicode-noncharacters/OTP-9624'Björn Gustavsson
* bjorn/unicode-noncharacters/OTP-9624: Allow noncharacter code points in unicode encoding and decoding
2011-10-18Merge branch 'sverker/random-improved-algo'Sverker Eriksson
* sverker/random-improved-algo: Improve algorithm in module random. Fix a bug in the implementation of the pseudo-random number generator OTP-8713
2011-10-17Make epp search directory of current file first when including another fileRichard Carlsson
The expected behaviour of a C-style preprocessor (such as Erlang's epp) is to allow a header file to include another header file in the same directory even though that directory is not explicitly in the include path, and even if the actual include path might reference another directory containing a file with the same name. For example, if src/foo.erl explicitly includes "../include/foo.hrl", then foo.hrl should be able to include "bar.hrl" in that same directory even though "../include" might not be in the search path, and even if another file named bar.hrl could be found using the search path it should not override the one in the same directory as foo.hrl. In Erlang, the most common situation is that a user of an installed application includes a main public header file using include_lib ("appname/include/foo.hrl") and that file includes a secondary header file "bar.hrl". However, if it does this using include_lib, it causes a bootstrapping problem - in the build environment for the application itself, the application is not necessarily found by name. On the other hand, if foo.hrl uses a plain include, then bar.hrl might be found when the application is built (if explicit paths are set in the makefils) but not later on when a user includes the main header file of the installed application via include_lib. By making -include always look in the directory of the current file before it uses the search path, this problem is remedied, and include directives behave in a more intuitive way. This completes a partial fix in R11 that only worked for include_lib().
2011-10-17Fix a bug in Dets concerning repair of almost full tablesHans Bolinder
A Dets table with sufficiently large buckets could not always be repaired. (Reported by Gordon Guthrie.) The format of Dets files has been modified. When downgrading tables created with the new system will be repaired. Otherwise the modification should not be noticeable.
2011-10-17Correct the docsHans Bolinder
2011-10-13Allow noncharacter code points in unicode encoding and decodingBjörn Gustavsson
The two noncharacter code points 16#FFFE and 16#FFFF were not allowed to be encoded or decoded using the unicode module or bit syntax. That causes an inconsistency, since the noncharacters 16#FDD0 to 16#FDEF could be encoded/decoded. There is two ways to fix that inconsistency. We have chosen to allow 16#FFFE and 16#FFFF to be encoded and decoded, because the noncharacters could be useful internally within an application and it will make encoding and decoding slightly faster. Reported-by: Alisdair Sullivan
2011-10-10Add a warning to docs about workers' shutdown strategyChristopher Faulet
2011-10-10Allow an infinite timeout to shutdown worker processesChristopher Faulet
Now, in child specification, the shutdown value can also be set to infinity for worker children. This restriction was removed because this is not always possible to predict the shutdown time for a worker. This is highly application-dependent.
2011-10-10Fix a minor bug in DetsHans Bolinder
If a Dets table had been properly closed but the space management data could not been read, it was not possible to repair the file.
2011-10-07Add '-callback' attributes in stdlib's behavioursStavros Aronis
Replace the behaviour_info(callbacks) export in stdlib's behaviours with -callback' attributes for all the callbacks.
2011-10-07Automatically generate 'behaviour_info' function from '-callback' attributesStavros Aronis
'behaviour_info(callbacks)' is a special function that is defined in a module which describes a behaviour and returns a list of its callbacks. This function is now automatically generated using the '-callback' specs. An error is returned by lint if user defines both '-callback' attributes and the behaviour_info/1 function. If no type info is needed for a callback use a generic spec for it.
2011-10-07Add '-callback' attribute to language syntaxStavros Aronis
Behaviours may define specs for their callbacks using the familiar spec syntax, replacing the '-spec' keyword with '-callback'. Simple lint checks are performed to ensure that no callbacks are defined twice and all types referred are declared. These attributes can be then used by tools to provide documentation to the behaviour or find discrepancies in the callback definitions in the callback module.
2011-10-04Merge branch 'dev' into majorBjörn-Egil Dahlberg
2011-10-04Prepare releaseOTP_R14B04Erlang/OTP
2011-09-29Merge branch 'dev' into majorBjörn-Egil Dahlberg
* dev: Update copyright years
2011-09-29Update copyright yearsBjörn-Egil Dahlberg
2011-09-28Merge branch 'bjorn/line-numbers/OTP-9468' into majorBjörn Gustavsson
* bjorn/line-numbers/OTP-9468: beam_lib_SUITE: Don't assume that "Abst" is the last chunk test_server: Show line number for caller of test_server:fail()
2011-09-28Merge branch 'dev' into majorBjörn Gustavsson
* dev: distribution_SUITE:bulk_send_bigbig/1: Fail with more information distribution_SUITE: Use unique slave node names beam_lib: Handle rare race in the crypto key server functionality busy_port_SUITE: Avoid crash in register/2 [wx] Re-generate code [wx] Remove optional shadowing clauses [wx] Remove warning [wx] Fix trailing whitespace [wx] Test colors in textctrl [wx] Fix cleanup memory references
2011-09-28Merge branch 'bjorn/stdlib/fix-beam_lib-race/OTP-9586' into devBjörn Gustavsson
* bjorn/stdlib/fix-beam_lib-race/OTP-9586: beam_lib: Handle rare race in the crypto key server functionality
2011-09-27beam_lib: Handle rare race in the crypto key server functionalityBjörn Gustavsson
In rare circumstances, there can be a race when the crypto key server is started by beam_lib:crypto_key_fun/1 shortly after stopping it using beam_lib:clear_crypto_key_fun/0. The race occurs because the crypto key server first sends back the reply to the calling process, then terminates. (The race is probably more likely to happen on CPUs with hyper threading.)
2011-09-27Merge branch 'dev' into majorHans Bolinder
* dev: Improve the generation of man pages Correct XML files
2011-09-26Merge branch 'dev' into majorLukas
* dev: Add documentation for cth_log_redirect and built-in hooks Correct wrong match from lists:keyfind Update cth_log_redirect to wait for all error_logger events before ending test Force logging to framework log for parallel tests Add ct_log:ct_log funcion Add a hook for redirecting SASL and error_logger messages Add -enable_builtin_hooks <bool> config option Export write_events and add option to return a string
2011-09-26Merge branch 'lukas/common_test/system_logs_to_ct_log/OTP-9543' into devLukas
* lukas/common_test/system_logs_to_ct_log/OTP-9543: Add documentation for cth_log_redirect and built-in hooks Correct wrong match from lists:keyfind Update cth_log_redirect to wait for all error_logger events before ending test Force logging to framework log for parallel tests Add ct_log:ct_log funcion Add a hook for redirecting SASL and error_logger messages Add -enable_builtin_hooks <bool> config option Export write_events and add option to return a string
2011-09-26Correct XML filesHans Bolinder
2011-09-20Export write_events and add option to return a stringLukas Larsson
2011-09-20Merge branch 'dev' into majorHenrik Nord
Conflicts: erts/aclocal.m4 erts/include/internal/ethread_header_config.h.in
2011-09-20Merge branch 'ta/docs-fixes' into devHenrik Nord
* ta/docs-fixes: Fix misspelling of intermediate Fix typos in erts/preloaded/src Fix more misspellings of compatibility Fix misspelling of kept Fix misspelling of compatibility in ssl_basic_SUITE Fix misspelling of compatibility Fix misspelling of accommodate Fix misspelling of exceed Fix misspelling of accidentally Fix misspelling of erroneous in xmerl_xsd Fix misspelling of erroneous Fix misspelling of successful Fix typos in instrument(3) Fix typos in dbg(3) dialyzer: fix a small typo in list_to_bitstring test Fix typos in cover.erl Fix typos (variable name) in erl_nif(3) Fix typos in mod_esi(3) Fix trivial typos in erlang(3) OTP-9555
2011-09-19Merge branch 'dev' into majorBjörn Gustavsson
* dev: tar_SUITE: Work around limited pathname length on Windows Merge the fourth bootstrap stage into the third bootstrap stage Remove unused lib/orber/include/Makefile Remove lib/orber/include/* from the primary bootstrap otp_build update_primary: Don't commit generated source files primary bootstrap: Remove source files Conflicts: Makefile.in bootstrap/bin/start.script bootstrap/bin/start_clean.script bootstrap/lib/compiler/ebin/compiler.app bootstrap/lib/compiler/egen/beam_opcodes.erl bootstrap/lib/compiler/egen/core_parse.erl bootstrap/lib/kernel/ebin/kernel.app bootstrap/lib/kernel/ebin/kernel.appup bootstrap/lib/orber/include/Makefile bootstrap/lib/orber/include/corba.hrl bootstrap/lib/orber/include/orber_pi.hrl bootstrap/lib/stdlib/ebin/stdlib.app bootstrap/lib/stdlib/ebin/stdlib.appup bootstrap/lib/stdlib/egen/erl_parse.erl
2011-09-19Merge branch 'bjorn/stdlib/fix-tar_SUITE' into devBjörn Gustavsson
* bjorn/stdlib/fix-tar_SUITE: tar_SUITE: Work around limited pathname length on Windows
2011-09-16Merge branch 'dev' into majorBjörn-Egil Dahlberg
* dev: Cleanup ETS bif's in hipe:erl_bif_types.erl (for dialyzer) Conflicts: erts/emulator/beam/erl_db.c
2011-09-16Merge branch 'pan/erl-bif-types/OTP-9496' into devBjörn-Egil Dahlberg
* pan/erl-bif-types/OTP-9496: Cleanup ETS bif's in hipe:erl_bif_types.erl (for dialyzer)
2011-09-16Explain how dynamic child processes are stoppedChristopher Faulet
2011-09-16Stack errors when dynamic children are stoppedChristopher Faulet
Because a simple_one_for_one supervisor can have many workers, we stack errors during its shutdown to report only one message for each encountered error type. Instead of reporting the child's pid, we use the number of concerned children.
2011-09-16Explicitly kill dynamic children in supervisorsChristopher Faulet
According to the supervisor's documentation: "Important note on simple-one-for-one supervisors: The dynamically created child processes of a simple-one-for-one supervisor are not explicitly killed, regardless of shutdown strategy, but are expected to terminate when the supervisor does (that is, when an exit signal from the parent process is received)." All is fine as long as we stop simple_one_for_one supervisor manually. Dynamic children catch the exit signal from the supervisor and leave. But, if this happens when we stop an application, after the top supervisor has stopped, the application master kills all remaining processes associated to this application. So, dynamic children that trap exit signals can be killed during their cleanup (here we mean inside terminate/2). This is unpredictable and highly time-dependent. In this commit, supervisor module is patched to explicitly terminate dynamic children accordingly to the shutdown strategy. NOTE: Order in which dynamic children are stopped is not defined. In fact, this is "almost" done at the same time.
2011-09-16tar_SUITE: Work around limited pathname length on WindowsBjörn Gustavsson
Ever since the test suites were converted to the common_test convention, the tests for long names started to fail on Windows. The reason is that those test cases depend on the current working directory, and that the current working directory in common_test test cases is usually set to a directory with a longer pathname than in test_server test suites. Since neither Erlang/OTP nor common_test provides a portable way to create a temporary directory with a short name, we will have to abuse priv_dir by going upwards from it. For further information, see the comment in run_in_short_tempdir/2.
2011-09-15Fix misspelling of compatibilityTuncer Ayaz
2011-09-15Fix misspelling of successfulTuncer Ayaz
2011-09-14Merge branch 'dev' into majorLukas Larsson
* dev: Add a high value to test data to catch type cast truncation errors
2011-09-14Merge branch 'lukas/erts/ets_order_testcases/OTP-9459' into devLukas Larsson
* lukas/erts/ets_order_testcases/OTP-9459: Add a high value to test data to catch type cast truncation errors
2011-09-13beam_lib_SUITE: Don't assume that "Abst" is the last chunkBjörn Gustavsson
"Line" is now the last chunk in a BEAM file, causing beam_lib_SUITE:error/1 to fail. To avoid being bitten by this problem again, don't simply change "Abst" to "Line", but use beam_lib:info/1 to find out the name of the last chunk.
2011-09-12Cleanup ETS bif's in hipe:erl_bif_types.erl (for dialyzer)Patrik Nyblom
2011-09-09Merge branch 'bmk/inets/inets58_integration' into majorMicael Karlberg
[httpc] Deprecated interface module <c>http</c> has been removed. It has (long) been replaced by http client interface module httpc. OTP-9359 [httpc|httpd] The old ssl implementation (based on OpenSSL), has been deprecated. The config option that specified usage of this version of the ssl app, *ossl*, has been removed. OTP-9522
2011-09-08Merge branch 'dev' into majorHenrik Nord