aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
AgeCommit message (Collapse)Author
2018-09-05Merge branch 'maint'Sverker Eriksson
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-04Merge branch 'maint'Sverker Eriksson
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 branch 'maint'Péter Dimitrov
* maint: Updated OTP version Update release notes stdlib: Let dets:open_file() crash when given raw file name Fix kernel_app doc logger_level default from info to notice Change-Id: I581946ac5cec6574ed79017e2987039c1fdcf80a
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-27Merge branch 'maint'Hans Bolinder
* maint: Document allowed integer ops in types stdlib: Fix specs of filename:basedir/2,2
2018-08-22stdlib: Fix specs of filename:basedir/2,2Hans Bolinder
See also https://bugs.erlang.org/browse/ERL-667.
2018-08-21Merge branch 'maint'Hans Bolinder
* maint: stdlib: Correct contracts in module io_lib_format stdlib: Improve error handling in module io_lib
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-16Merge branch 'josevalim/jv-sb/PR-1803/OTP-15238' into masterLukas Larsson
Optimize binary match from 10% up to 70x
2018-08-13Merge branch 'maint'Björn Gustavsson
* maint: Correct error behavior of is_map_key/2 in guards
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-07Optimize binary matchJosé Valim
The idea is to use memchr on the first lookup for binary:match/2 and also after every match on binary:matches/2. We only use memchr in case of matches because benchmarks showed that using memchr even when we had false positives could negatively affect performance. This speeds up binary matching and binary splitting by 4x in some cases and by 70x in other scenarios (when the last character in the needle does not occur in the subject). The reason to use memchr is that it is highly specialized in most modern operating systems, often defaulting to SIMD operations. The implementation uses the reduction count to figure out how many bytes should be read with memchr. We could increase those numbers but they do not seem to make a large difference.
2018-07-27Change "can not" into "cannot"Raimo Niskanen
I did not find any legitimate use of "can not", however skipped changing e.g RFCs archived in the source tree.
2018-07-25Merge pull request #1886 from michalmuskala/mm/maps-refactorJohn Högberg
Refactor maps.erl
2018-07-23Refine types of functions in maps moduleMichał Muskała
This only touches functions that are not further manually enhanced in erl_bif_types. The hope is that this will allow dialyzer to discover more issues in code using maps.
2018-07-20Merge PR-1878 from michalmuskala/mm/map-new-bif-2 OTP-15200Sverker Eriksson
maps:new/0 is no longer a BIF
2018-07-19Optimise functions in the maps moduleMichał Muskała
Using direct pattern matching on the map is more effient than pattern matching on the result of maps:find/2, because it avoids allocating the intermediate tuple.
2018-07-18Merge pull request #1812 from michalmuskala/mm/make-fun-loaderJohn Högberg
Optimise creation of anonymous functions
2018-07-17maps:new/0 is no longer a BIFMichał Muskała
Implementing it in Erlang allows taking advantage of the literal pool optimisation, this means the function implemented in Erlang does no allocations, while the BIF had to allocate new map each time it was called. Benchmarks show the function is also slightly faster now.
2018-07-17Optimise creation of anonymous functionsMichał Muskała
This introduces a similar optimisation for normal funs to what was introduced for external funs in #1725. It is possible to allocate the fun as a literal, if it does not capture the environment (i.e. it does not close over any variables). Unfortunately it's not possible to do this in the compiler due to problems with representation of such functions in the `.beam` files. Fortunately, we can do this in the loader. Simple evaluation shows that functions that don't capture the enviornment consistute over 60% of all funs in the source code of Erlang/OTP itself. The only downside is that we lose a meningful value in the `pid` field of the fun. The goal of this field, beyond debugging, was to be able to identify the original node of a function. To be able to still do this, the functions that are created in the loader are assigned the init pid as the creator. To solve issues with staryp, initially set the `erts_init_process_id` to `ERTS_INVALID_PID` and skip the described optimisation if the value is still uninitialised.
2018-07-16Merge branch 'maint'Lukas Larsson
2018-07-16Merge branch 'lukas/clean_doc_xmldir/OTP-15190' into maintLukas Larsson
* lukas/clean_doc_xmldir/OTP-15190: docs: make clean all XMLDIR
2018-07-13docs: make clean all XMLDIRLukas Larsson
2018-07-13Merge branch 'maint'Siri Hansen
2018-07-13Merge branch 'siri/logger/post-21/OTP-15132' into maintSiri Hansen
* siri/logger/post-21/OTP-15132: [logger] Allow setting kernel parameter 'logger_level' to 'all' [kernel] Reduce risk of dead lock when terminating logger_sup [logger] Fix regexp replacement for unicode strings Update proc_lib:report_cb to obey logger formatter's size limiting params [logger] Allow report callback with two arguments returning a string Don't call report_cb from cth_log_redirect - formatter does that Add legacy test of sasl_report_file_h and size limiting [logger] Remove compiler warnings in test [logger] Fix problem with test cases waiting for handler restart [logger] Add ?LOG macro which takes Level as argument [logger] Improve spec for set_handler_config/3 and set_primary_config/2 [logger] Generate .png file from .dia [logger] Update documentation
2018-07-13Update proc_lib:report_cb to obey logger formatter's size limiting paramsSiri Hansen
2018-07-04Merge branch 'maint'John Högberg
* maint: Updated OTP version Update release notes Update version numbers Eliminate a crash in the beam_jump pass stdlib: Fix a 'chars_limit' bug Fix a race condition when generating async operation ids Fix internal compiler error for map_get/2 beam_type: Fix unsafe optimization public_key: Remove moduli 5121 and 7167 Thoose were added by 598629aeba9de98e8cdf5637043eb34e5d407751 but are not universaly supported.
2018-07-04Merge branch 'maint-21' into maintJohn Högberg
* maint-21: Updated OTP version Update release notes Update version numbers Eliminate a crash in the beam_jump pass stdlib: Fix a 'chars_limit' bug Fix a race condition when generating async operation ids Fix internal compiler error for map_get/2 beam_type: Fix unsafe optimization public_key: Remove moduli 5121 and 7167 Thoose were added by 598629aeba9de98e8cdf5637043eb34e5d407751 but are not universaly supported.
2018-07-03Merge pull request #1854 from ↵John Högberg
jhogberg/john/erts/cross-type-carrier-migration/OTP-15063 Allow carrier migration between different allocator types
2018-06-29Update release notesErlang/OTP
2018-06-29Update version numbersErlang/OTP
2018-06-29Merge branch 'maint'Hans Bolinder
* maint: Fix typo in erl_parse type unary_op()
2018-06-29Merge pull request #1853 from gomoripeti/fix_type_unary_opHans Bolinder
Fix typo in erl_parse type unary_op()
2018-06-28Merge branch 'maint'Sverker Eriksson
2018-06-28Merge PR-1844 from arcz/ets_count OTP-15163Sverker Eriksson
Use erlang:system_info(ets_count) and improve docs
2018-06-28Fix typo in erl_parse type unary_op()Péter Gömöri
2018-06-28Merge branch 'maint'Hans Bolinder
* maint: stdlib: Add a few uses of erl_anno
2018-06-28stdlib: Fix a 'chars_limit' bugHans Bolinder
2018-06-28Remove ad-hoc memory use calculations in testsJohn Högberg
2018-06-27Merge pull request #1840 from tsloughter/qs-dissectPéter Dimitrov
uri_string: support key without value in query string
2018-06-25stdlib: Add a few uses of erl_annoHans Bolinder
With DEBUG=true in erl_anno, erl_parse, and erl_pp a few (harmless) non-opaque accesses of annotations were found.
2018-06-20Use bif for other ets tables countingArtur Cygan
2018-06-19Prepare releaseErlang/OTP
2018-06-18Update copyright yearHenrik Nord
2018-06-15support key without value in query stringTristan Sloughter