aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
AgeCommit message (Collapse)Author
2016-02-25Update appups in kernel, stdlib and sasl for OTP-18.3Siri Hansen
2016-02-25Merge branch 'benwilson512/better-maps-with' into maintHenrik Nord
* benwilson512/better-maps-with: Improved maps:with/2 and maps:without/2 algorithm OTP-13376
2016-02-17stdlib: Add suppression of Dialyzer warningsHans Bolinder
2016-02-10Merge branch 'nybek/speed_up_supervisor_count_children' into maintSiri Hansen
* nybek/speed_up_supervisor_count_children: Speed up supervisor:count_children/1; simple_one_for_one Add supervisor:get_callback_module/1 OTP-13290
2016-02-09Improved maps:with/2 and maps:without/2 algorithmBen Wilson
The current implementation is roughly O(N*M) where N is the number of items to be removed, and M is the number of items in the map. This does not include the cost of `maps:from_list` or `maps:to_list`. This leads to pretty horrifying execution times on large maps regardless of how many or few keys are to be removed. The new implementation is O(N) where N is the number of items to be removed. For each N there's the cost of removing a key from a map, and but in practice that turns out to be a vast improvement for all map sizes I tested The new maps:take/2 implementation similarly builds a list of keys and values by iterating only the list of desired keys, and then hands it off to maps:from_list. This turned out to be faster than N maps:put calls.
2016-02-03Speed up supervisor:count_children/1; simple_one_for_oneRory Byrne
Speed up supervisor:count_children/1 for simple_one_for_one supervisors. This is achieved by avoiding looping through all the child process and verifying that each one is alive. For a supervisor with 100,000 'temporary' children the count-time will drop from approx 25ms to about 0.005ms. For a supervisor with 100,000 'permanent' or 'transient' children the count-time will drop from approx 30ms to about 0.005ms. This avoids having the supervisor block for an extended period while the count takes place. Under normal circumstances the accuracy of the result should also improve since the duration is too short for many processes to die during the count.
2016-02-03Add supervisor:get_callback_module/1Siri Hansen
This function is used by release_handler during upgrade. This was earlier implemented in the release_handler, but it required a copy og the definition of the supervisor's internal state, which caused problems when this state was updated.
2016-02-02Merge branch 'rickard/monotonic-time-improvements/OTP-13222' into maintRickard Green
* rickard/monotonic-time-improvements/OTP-13222: Introduce time management in native APIs Introduce time warp safe replacement for safe_fixed option Introduce time warp safe trace timestamp formats
2016-02-01Merge branch 'lrascao/stdlib/beam_lib-race-condition/OTP-13278' into maintBjörn Gustavsson
* lrascao/stdlib/beam_lib-race-condition/OTP-13278: Check for already started beam_lib crypto server
2016-01-29Merge branch 'josevalim/stdlib/edlin/OTP-13281' into maintBjörn Gustavsson
* josevalim/stdlib/edlin/OTP-13281: Do not consider "." part of names in edlin
2016-01-29Check for already started beam_lib crypto serverLuis Rascao
When starting the beam_lib crypto server, don't crash when it is already running. Some other process might have already called it.
2016-01-20Introduce time warp safe replacement for safe_fixed optionRickard Green
The new time warp safe option is safe_fixed_monotonic_time which gives erlang:monotonic_time(). The safe_fixed option was also slightly changed. It now gives erlang:timestamp() instead of erlang:now(). This has however not been documented, so it is considered a compatible change. The above effects both ets, and dets. This commit also include the bugfix OTP-13239 for dets:info(Tab, safe_fixed). The timestamp in the result returned by dets:info(Tab, safe_fixed) was unintentionally broken as a result of the time API rewrites in OTP 18.0.
2016-01-13Deprecate module 'overload' in SASLSiri Hansen
The module is deprected and will be removed in OTP 19. The reason is that the module is not used, and that we se no obvious use case for it.
2016-01-13stdlib: Fix linter crash due to missing -module declarationHans Bolinder
The Erlang Code Linter no longer crashes if there is a -deprecated() attribute but no -module() declaration. See also ERL-62 at bugs.erlang.org.
2016-01-13stdlib: fix erl_eval not using non-local function handlerHans Bolinder
See also ERL-32 at bugs.erlang.org. Thanks to Ben Paxton.
2016-01-01Do not consider "." part of names in edlinJosé Valim
Today, if you press Ctrl+W inside erl, it will erase word chars including dots. This may have made sense in the past when Erlang had packages, but today considering the most common case for dots inside erl is to work with records, considering the dot part of the word is rather a mistake. For example, imagine the following code, where [] is the cursor: 1> S#elixir_scope.name[] When I press Ctrl+W it erases all up to #: 1> S#[] This patch changes it to the dot is no longer considered part of the name: 1> S#elixir_scope.[] Which is rather expected behaviour for most use cases of dot in Erlang.
2015-12-28Merge branch 'josevalim/jv-map-fun-eval-maint' into maintZandra
* josevalim/jv-map-fun-eval-maint: Use full list of bindings when matching on map keys OTP-13218
2015-12-15Update release notesErlang/OTP
2015-12-15Update version numbersErlang/OTP
2015-12-11Update appups in kernel, stdlib and sasl for OTP-18.2Siri Hansen
2015-12-07Merge branch 'bjorn/stdlib/rand-export_seed/OTP-13162' into maintBjörn Gustavsson
* bjorn/stdlib/rand-export_seed/OTP-13162: Correct rand:export_seed/0 when there is no prior seed
2015-12-07Correct rand:export_seed/0 when there is no prior seedBjörn Gustavsson
According to the documentation, rand:export_seed/0 should return 'undefined' if the seed has not been intialized. However, it will create and return a seed. That means that the following code will not work as expected: case rand:export_seed() of undefined -> rand:seen({1,2,3}); _ -> ok end, rand:uniform(Range)
2015-12-07stdlib: Correct pretty-printing of map typesHans Bolinder
Add parentheses around annotated type union elements in map pair types. The bug was introduced in Erlang/OTP 18.0.
2015-12-07stdlib: Pretty-print constraints as 'V :: T'Hans Bolinder
Print constraints as 'V :: T' rather than 'is_subtype(V, T)'.
2015-12-03Extend erl_lint:format_error/1 to handle bittype mismatchesBjörn Gustavsson
erl_lint:format_error/1 would crash with a function error if conflicting types were given. That was most easily noticed in the shell: Eshell V7.0.3 (abort with ^G) 1> <<0/integer-binary>>. *** ERROR: Shell process terminated! *** Noticed-by: Aleksei Magusev
2015-12-03erl_lint_SUITE: Add smoke test of format_error/1Björn Gustavsson
The test suite depended on the compiler to call erl_lint:format_error/1 to ensure that format_error/1 was covered. Unfortunately, though, if format_error/1 crashed the compiler would catch the exception so that the test suite would not notice it. Add a smoke test of format_error/1 that will crash if there is any problem with erl_lint:format_error/1.
2015-11-27stdlib: Fix the shell command rp and pretty-printingHans Bolinder
The shell command 'rp' prints strings as lists of integers when pretty printing of lists is 'false'.
2015-11-20Merge branch 'riverrun/maint' into maintZandra
* riverrun/maint: Recommend against using crypto:rand_bytes
2015-11-06Recommend against using crypto:rand_bytesDavid Whitlock
2015-11-04Fix typos and grammarDerek Brown
2015-11-04[stdlib] Correct documentationHans Bolinder
Fix mistakes found by 'xmllint'.
2015-11-03Fix spelling error in "characters_to_list"Gary Coulbourne
2015-10-22beam_lib: Document all_chunks/1 and build_module/1Björn Gustavsson
beam_lib:all_chunks/1 and beam_lib:build_module/1 can be useful for special-purpose stripping, for example to remove the "Line" chunk.
2015-10-19Use full list of bindings when matching on map keysJosé Valim
Prior to this patch, the following code would not eval: X = key, (fun(#{X := value}) -> true end)(#{X => value}) That's because the key evaluation was using the new list of bindings introduced on every anonymous fun. Since keys only match on values defined prior to the pattern and do not introduce any new binding, we must use the full and original list of binding.
2015-10-13Fixed typo in ets documentationRiccardo
2015-10-08Merge branch 'tomszilagyi/shell-support-del-home-end' into maintZandra
OTP-12032 * tomszilagyi/shell-support-del-home-end: Erlang shell: Support keys Del, Home and End
2015-10-02Merge branch 'nybek/supervisor_reporting_error' into maintZandra
* nybek/supervisor_reporting_error: Fix supervisor reporting error
2015-09-21Prepare releaseErlang/OTP
2015-09-18Update application versionsHans Bolinder
2015-09-18Merge branch 'dgud/stdlib/fix-file-error_log-leak' into maintDan Gudmundsson
* dgud/stdlib/fix-file-error_log-leak: stdlib: Fix leaking files after error_logger:logfile(close)
2015-09-17stdlib: Fix leaking files after error_logger:logfile(close)Dan Gudmundsson
Introduced when changing state from tuple to record.
2015-09-17Merge branch 'leoliu/export-catch_exception' into maintHenrik Nord
* leoliu/export-catch_exception: Export shell:catch_exception/1 as documented
2015-09-17stdlib: Update application versionHans Bolinder
2015-09-14Merge branch 'bjorn/cuddle-with-tests' into maintBjörn Gustavsson
* bjorn/cuddle-with-tests: (23 commits) rand_SUITE: Speed up basic_stats/1 base64_SUITE: Speed up roundtrip/1 lists_SUITE: Test lists:concat/2 lists_SUITE: Test lists:split/2 lists_SUITE: Add a test case for lists:prefix/2 lists_SUITE: Add hof/1 to test all high-order functions lists_SUITE: Add test for lists:takewhile/1 lists_SUITE: Run test cases in each group in parallel lists_SUITE: Test lists:keyreplace/4 lists_SUITE: Extend flatten/1 test to also test flatlength/1 lists_SUITE: Correct test of lists:flatten/2 id_transform_SUITE: Modernize test suite io_proto_SUITE: Speed up determination of default shell io_proto_SUITE: Refactor up rtnode() and friends gen_event_SUITE: Remove unnecessary sleep calls proc_lib: Improve coverage for crash/1 proc_lib_SUITE: Eliminate compiler warnings io_SUITE: Add coverage/1 to completely cover io_lib_pretty io_SUITE: Extend coverage of code for testing printable chars io_SUITE: Speed up test for bad +pc option ...
2015-09-11rand_SUITE: Speed up basic_stats/1Björn Gustavsson
Refactor basic_stats/1 into three separate test cases that can be run in parallel.
2015-09-11base64_SUITE: Speed up roundtrip/1Björn Gustavsson
Refactor roundtrip/1 into 4 test cases that can be run in parallel. Assuming that there are 4 cores available, the group of 4 test cases will run at roughly one fourth of the time for the original test case.
2015-09-11lists_SUITE: Test lists:concat/2Björn Gustavsson
2015-09-11lists_SUITE: Test lists:split/2Björn Gustavsson
2015-09-11lists_SUITE: Add a test case for lists:prefix/2Björn Gustavsson
2015-09-11lists_SUITE: Add hof/1 to test all high-order functionsBjörn Gustavsson