aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
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-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-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-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-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-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-10Merge branch 'howleysv/stdlib/compiled-unicode/OTP-12977' into maintBjörn Gustavsson
* howleysv/stdlib/compiled-unicode/OTP-12977: stdlib: Fix bug with unicode detection in re
2015-09-09stdlib: Fix bug with unicode detection in reShane Howley
Fix bug with unrecognised 'unicode' option in re:split/2,3 & re:replace/3,4 when using pre-compiled regex.
2015-09-07proc_lib: Add format/3Björn Gustavsson
We'll need a way to limit the size of the crash report produced by proc_lib:format(). Add format/3, where the third argument is a depth argument.
2015-09-07Teach error_logger_tty_h to truncate big messagesBjörn Gustavsson
Add the possibility to truncate big messages to avoid running out of memory.
2015-09-07error_logger_tty_h: Refactor and modernize codeBjörn Gustavsson
Refactor, simplify, and modernize the code to facilitate future improvements in the following commits.
2015-09-07Teach error_logger_file_h to truncate big messagesBjörn Gustavsson
Add the possibility to truncate big messages to avoid running out of memory.
2015-09-07error_logger_file_h: Refactor and modernize codeBjörn Gustavsson
Refactor, simplify, and modernize the code to facilitate future improvements in the following commits.
2015-09-07Remove unused code in error logger handlersBjörn Gustavsson
A long time ago, errors from the emulator itself was sent as messages that would end up in the handle_info/2 function. Those clauses in handle_info/2 can be removed. The code for handling events tagged 'info' instead of 'info_msg' can also be taken out.
2015-08-26Merge branch 'dgud/stdlib/zip-optimize/OTP-12950' into maintDan Gudmundsson
* dgud/stdlib/zip-optimize/OTP-12950: Optimize zip:unzip/2 when uncompressing to memory
2015-08-24Optimize zip:unzip/2 when uncompressing to memoryDan Gudmundsson
Optimize the case where we are appending to the end of the binary, use binary syntax to create binaries with room for expansion in the next loop, instead of using iolist_to_binary which creates a binary of the exact size and needs to be copied in each loop. Also remove support the unused Acc as iolists.
2015-08-21stdlib: fix a qlc bug introduced in 18.0Hans Bolinder
As pointed out by roowe, qlc does not handle errors in early compiler (scanner, parser) well in OTP 18.0.
2015-07-16Erlang shell: Support keys Del, Home and EndTom Szilagyi
Add support for the Delete, Home and End keys in the Erlang shell. These keys are ubiquitous on modern keyboards. Having them working as expected adds to the convenience of working in the shell, since they are much easier to use than the corresponding Ctrl-{D,A,E} keys. The implementation is in line with the existing framework of the line editor and is thus a natural (and minimal) extension.
2015-07-07Export shell:catch_exception/1 as documentedLeo Liu
2015-06-22fix errors caused by changed line numbersBruce Yinhe
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-16Merge branch 'nybek/fix_supervisor_get_childspec'Zandra Hird
* nybek/fix_supervisor_get_childspec: Fix supervisor:get_childspec/2 for simple_one_for_one OTP-12841
2015-06-16Merge branch 'ia/inets/deprecate'Ingela Anderton Andin
* ia/inets/deprecate: inets: Fix race condition in httpc inets: Remove use of httpd_conf:clean/1 and httpd_conf:custom_clean/3 inets: Remove use of httpd_conf:make_integer/1 inets: Deprecate functions in util module httpd_conf.erl
2015-06-15inets: Deprecate functions in util module httpd_conf.erlIngela Anderton Andin
These functions should not be used, there exists better functions in the standard libraries.