aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
AgeCommit message (Collapse)Author
2018-11-14Merge branch 'maint-18' into maintLukas Larsson
* maint-18: Updated OTP version Prepare release Optimize operator '--' and yield on large inputs Conflicts: OTP_VERSION erts/doc/src/notes.xml erts/emulator/beam/erl_alloc.types erts/emulator/beam/erl_bif_lists.c erts/vsn.mk lib/stdlib/doc/src/notes.xml lib/stdlib/vsn.mk make/otp_version_tickets otp_versions.table
2018-11-09Prepare releaseErlang/OTP
2018-11-09Merge branch 'john/erts/OTP-18.3.4/minusminus_trapping/OTP-15371' into maint-18Erlang/OTP
* john/erts/OTP-18.3.4/minusminus_trapping/OTP-15371: Optimize operator '--' and yield on large inputs
2018-11-09Merge branch 'maint-20' into maintLukas Larsson
* maint-20: Updated OTP version Prepare release Optimize operator '--' and yield on large inputs Conflicts: OTP_VERSION erts/doc/src/notes.xml erts/emulator/beam/erl_alloc.types erts/emulator/beam/erl_bif_lists.c erts/vsn.mk lib/ssl/doc/src/notes.xml lib/ssl/vsn.mk lib/stdlib/doc/src/notes.xml lib/stdlib/vsn.mk make/otp_version_tickets otp_versions.table
2018-11-05Prepare releaseErlang/OTP
2018-11-05Merge branch 'john/erts/OTP-20.3.8/minusminus_trapping/OTP-15371' into maint-20Erlang/OTP
* john/erts/OTP-20.3.8/minusminus_trapping/OTP-15371: Optimize operator '--' and yield on large inputs
2018-11-05Optimize operator '--' and yield on large inputsJohn Högberg
The removal set now uses a red-black tree instead of an array on large inputs, decreasing runtime complexity from `n*n` to `n*log(n)`. It will also exit early when there are no more items left in the removal set, drastically improving performance and memory use when the items to be removed are present near the head of the list. This got a lot more complicated than before as the overhead of always using a red-black tree was unacceptable when either of the inputs were small, but this compromise has okay-to-decent performance regardless of input size. Co-authored-by: Dmytro Lytovchenko <[email protected]>
2018-11-02Optimize operator '--' and yield on large inputsJohn Högberg
The removal set now uses a red-black tree instead of an array on large inputs, decreasing runtime complexity from `n*n` to `n*log(n)`. It will also exit early when there are no more items left in the removal set, drastically improving performance and memory use when the items to be removed are present near the head of the list. This got a lot more complicated than before as the overhead of always using a red-black tree was unacceptable when either of the inputs were small, but this compromise has okay-to-decent performance regardless of input size. Co-authored-by: Dmytro Lytovchenko <[email protected]>
2018-11-02Merge branch 'john/erts/minusminus_trapping/OTP-15371' into maintJohn Högberg
* john/erts/minusminus_trapping/OTP-15371: Optimize operator '--' and yield on large inputs Inline erts_cmp Clarify a magical allocation size Fix trapping in lists:reverse/2
2018-10-29Optimize operator '--' and yield on large inputsJohn Högberg
The removal set now uses a red-black tree instead of an array on large inputs, decreasing runtime complexity from `n*n` to `n*log(n)`. It will also exit early when there are no more items left in the removal set, drastically improving performance and memory use when the items to be removed are present near the head of the list. This got a lot more complicated than before as the overhead of always using a red-black tree was unacceptable when either of the inputs were small, but this compromise has okay-to-decent performance regardless of input size. Co-authored-by: Dmytro Lytovchenko <[email protected]>
2018-10-24Fix docs on gen_event optional callbackBrujo Benavides
It returns `ok`, instead of `noreply`.
2018-10-24Merge pull request #1992 from bjorng/bjorn/stdlib/beam_lib/ERL-696Björn Gustavsson
beam_lib: Clarify the beam() type in code and documentation OTP-15378
2018-10-19beam_lib: Remove obsolete module() from the beam() typeBjörn Gustavsson
The type `beam()` in the `beam_lib` module is confusing: -type beam() :: module() | file:filename() | binary(). It says that the module name can be used to identify the BEAM module to be accessed, but passing in the module name only works if the BEAM file is located in the current working directory because the module is not searched for in the code path. The reason that it is allowed to pass in the module name as an atom is for backward compatibility. A long time ago, atoms instead of strings were used as filenames. For that reason, `filename` and `file` still accept atoms as filenames (although the practice is frown upon). `beam_lib` accepts an atom as the filename for the same reason. To remove the confusion, remove `module()` from the type and the mention of it in the documentation. Code that uses an atom as a filename will still work, but Dialyzer will issue a warning. https://bugs.erlang.org/browse/ERL-696
2018-10-19Merge branch 'siri/cuddle' into maintSiri Hansen
* siri/cuddle: Fix gen_fsm_SUITE:start2/1 to terminate process synchronously Fix sys_SUITE:special_process/1 to terminating process synchronously
2018-10-17kernel: Fix spelling error in assert.hrlLukas Larsson
2018-10-16Merge branch 'sverker/erts/ets-select_replace-bug/OTP-15346' into maint-20Erlang/OTP
* sverker/erts/ets-select_replace-bug/OTP-15346: erts: Fix bug in ets:select_replace for bound key
2018-10-16Fix gen_fsm_SUITE:start2/1 to terminate process synchronouslySiri Hansen
2018-10-16Fix sys_SUITE:special_process/1 to terminating process synchronouslySiri Hansen
2018-10-09Merge branch 'sverker/erts/ets-select_replace-bug/OTP-15346' into maintSverker Eriksson
* sverker/erts/ets-select_replace-bug/OTP-15346: erts: Fix bug in ets:select_replace for bound key
2018-10-09erts: Fix bug in ets:select_replace for bound keySverker Eriksson
which may cause following calls to ets:next or ets:prev to fail.
2018-10-08Merge branch 'john/compiler/deterministic-paths/OTP-15245/ERL-706' into maintJohn Högberg
* john/compiler/deterministic-paths/OTP-15245/ERL-706: compiler: Forward +source flag to epp and fix bug in +deterministic epp: Allow user to set source name independently of input file name
2018-10-05epp: Allow user to set source name independently of input file nameJohn Högberg
Note that this does *not* affect -include()'d files or the -file() directive.
2018-10-04Merge PR-1962 from gomoripeti/ms_bit_size OTP-15343Sverker Eriksson
Document bit_size in match-specs and allow in fun2ms
2018-10-03Merge branch 'raimo/test-cuddling' into maintRaimo Niskanen
* raimo/test-cuddling: Decrease probability for failed histogram
2018-09-28Decrease probability for failed histogramRaimo Niskanen
2018-09-27Update kernel, stdlib and sasl appups for OTP-21.2Siri Hansen
2018-09-25Document bit_size in match-specs and allow in fun2msPéter Gömöri
It is already allowed in match-specs.
2018-09-24Prepare releaseErlang/OTP
2018-09-21Update copyright yearHenrik Nord
2018-09-18Merge branch 'siri/cuddle' into maintSiri Hansen
* siri/cuddle: [logger] Skip app level test if app cannot be loaded Terminate nodes after failed test cases in erl_distribution_SUITE Skip performance test on build types other than 'opt'
2018-09-18Merge branch 'hasse/stdlib/binary_in_format/OTP-15304' into maintHans Bolinder
* hasse/stdlib/binary_in_format/OTP-15304: stdlib: Allow lists with binaries in the Format argument
2018-09-17test ets doc updatesverker-ets-patch-1Sverker Eriksson
2018-09-17stdlib: Allow lists with binaries in the Format argumentHans Bolinder
As a consequence of some refactoring (OTP-14983, option 'chars_limit'), the Format argument of io_lib:format() no longer accepts binaries in lists in Erlang/OTP 21.0. Note that if Format is not of type io:format(), control sequences in Format are ignored. This can result in unpredictable behaviour if, for example, the output of io_lib:format() is used as Format: if the output happens to be a string(), then control sequences are interpreted, otherwise not. A check that Format is of type io:format() will likely be introduced in Erlang/OTP 22.0. That will probably mean work for some users, but considering how unpredictable io_lib:format() is, we should try to fix that.
2018-09-17Skip performance test on build types other than 'opt'Siri Hansen
2018-09-12[proc_lib] Improve crash reports for single line loggingSiri Hansen
2018-09-12[logger] Remove encoding option from logger_formatterSiri Hansen
The encoding option was introduced in commit 270d909696a753af022df72a404c73f2895b4a02, to allow report callbacks to format according to a given encoding. There was, however, no connection between this encoding option, and the encoding of the device to which the logger handler was writing. Since a formatter is defined to return unicode:chardata(), and in order to avoid mismatch with the encoding of the device, the encoding option is now removed from the formatter. The handler itself must make sure that it does not write illegal data to its device.
2018-09-10Merge branch 'siri/supervisor/warn-shutdown-race/ERL-724' into maintSiri Hansen
* siri/supervisor/warn-shutdown-race/ERL-724: [supervisor] Add warning about race condition
2018-09-07[supervisor] Add warning about race conditionSiri Hansen
ERL-724: "During a 'gentle' shutdown, supervisors unlink from their children before sending shutdown signals to them. This can lead to a race condition in supervision trees, when the timeout for gentle shutdown of a parent supervisor expires and it kills a child supervisor that has just unlinked from a child of its own, leaving the child supervisor's own child still running after its supervisor is killed." This commit adds a warning about this in the documentation.
2018-09-06Merge branch 'rickard/pcre-8.42/OTP-15217' into maintRickard Green
* rickard/pcre-8.42/OTP-15217: Update PCRE from version 8.41 to version 8.42
2018-09-05Merge branch 'sverker/erts/ets-memstat-false-leak/ERL-720/OTP-15278' into maintSverker Eriksson
* sverker/erts/ets-memstat-false-leak/ERL-720/OTP-15278: erts: Refactor ets FixedDeletion allocations erts: Fix ets memstat false leak of FixedDeletion
2018-09-03erts: Fix ets memstat false leak of FixedDeletionSverker Eriksson
causing erlang:memory to report too much ets memory.
2018-08-31Fix type spec of ms_transform:parse_trans/2Péter Gömöri
It can also return errors and warnings.
2018-08-28Merge pull request #1940 from ↵Hans Bolinder
uabboli/hb/stdlib/fix_dets_file_name/OTP-15253/ERL-555 stdlib: Let dets:open_file() crash when given raw file name
2018-08-22stdlib: Fix specs of filename:basedir/2,2Hans Bolinder
See also https://bugs.erlang.org/browse/ERL-667.
2018-08-21stdlib: Let dets:open_file() crash when given raw file nameHans Bolinder
See also ERL-55 and OTP-13229.
2018-08-20stdlib: Correct contracts in module io_lib_formatHans Bolinder
2018-08-20stdlib: Improve error handling in module io_libHans Bolinder
2018-08-13Correct error behavior of is_map_key/2 in guardsBjörn Gustavsson
Consider the following functions: foo() -> bar(not_a_map). bar(M) when not is_map_key(a, M) -> ok; bar(_) -> error. What will `foo/0` return? It depends. If the module is compiled with the default compiler options, the return value will be `ok`. If the module is compiled with the `inline` option, the return value will be `error`. The correct value is `error`, because the call to `is_map_key/2` when the second argument is not a map should fail the entire guard. That is the way other failing guards BIFs are handled. For example: foo() -> bar(not_a_tuple). bar(T) when not element(1, T) -> ok; bar(_) -> error. `foo/0` always returns `error` (whether the code is inlined or not). This bug can be fixed by changing the classification of `is_map_key/2` in the `erl_internal` module. It is now classified as a type test, which is incorrect because type tests should not fail. Reclassifying it as a plain guard BIF corrects the bug. This correction also fixes the internal consistency check failure which was reported in: https://bugs.erlang.org/browse/ERL-699
2018-08-08Update PCRE from version 8.41 to version 8.42Rickard Green
2018-07-16Merge branch 'lukas/clean_doc_xmldir/OTP-15190' into maintLukas Larsson
* lukas/clean_doc_xmldir/OTP-15190: docs: make clean all XMLDIR