aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2018-04-26Update cth_log_redirect to a logger handlerSiri Hansen
2018-04-26Start using logger internally in kernel and stdlibSiri Hansen
2018-04-26Remove error_logger process and add logger processSiri Hansen
2018-04-26Add loggerSiri Hansen
2018-04-26Merge pull request #1797 from bjorng/bjorn/compiler/fold-apply/ERL-614Björn Gustavsson
Rewrite a call of a literal external fun to a direct call OTP-15044
2018-04-26Merge branch 'bjorn/compiler/misc'Björn Gustavsson
* bjorn/compiler/misc: beam_validator: Clear X registers in wait_timeout sys_core_fold: Eliminate crash for map update in guard
2018-04-26Merge branch 'hans/ssh/cuddle_tests'Hans Nilsson
* hans/ssh/cuddle_tests: ssh: Better logging in test case
2018-04-25public_key: Add markers for private and public keysHans Nilsson
2018-04-25crypto: Add marker for engine_refHans Nilsson
2018-04-25ssh: Use -spec and -type for documentation generationHans Nilsson
2018-04-25Merge branch 'hasse/stdlib/chars_limit_io/OTP-14983'Hans Bolinder
* hasse/stdlib/chars_limit_io/OTP-14983: stdlib: Modify the printing of map associations with wWpP stdlib: Introduce characters limit of formated strings stdlib: Modify ~w/~W when number of characters is limited stdlib: io_lib{_pretty}: Avoid tuple_to_list when possible stdlib: Introduce characters limit of formatted strings
2018-04-25stdlib: Modify the printing of map associations with wWpPHans Bolinder
Use the same depth for all (printed) elements of a map. Since the order of keys can vary when printing a map--maps:iterator/1 and maps:next/1 are used--it is more consistent to print all associations with the same depth. If the associations printed are limited by the depth, the selection of associations is arbitrary, as before.
2018-04-25stdlib: Introduce characters limit of formated stringsHans Bolinder
Inspiration from module lager_format. Also some improvements of Unicode handling. io_lib:format/3 and io_lib:fwrite/3 are new functions. The representation of the options is a list, but we are considering using a map instead. If we change, it will happen after Erlang/OTP 21.0-rc1 is released.
2018-04-25ssh: Changes suggested by dialyzerHans Nilsson
2018-04-25ssh: New -spec and -typeHans Nilsson
2018-04-25ssh: Better logging in test caseHans Nilsson
2018-04-25Rewrite a call of a literal external fun to a direct callBjörn Gustavsson
Rewrite calls such as: (fun erlang:abs/1)(-42) to: erlang:abs(-42) While we are at it, also add rewriting of apply/2 with a fixed number of arguments to a direct call of the fun. For example: apply(F, [A,B]) would be rewritten to: F(A, B) https://bugs.erlang.org/browse/ERL-614
2018-04-25stdlib: Modify ~w/~W when number of characters is limitedHans Bolinder
A bug fix: limited maps end with "...", not "...=>...". A modification: wW separate pairs with " => ", not "=>". When the output is limited on number of characters, the term is balanced by wW the same way as is done with pP (see commit bc38638).
2018-04-25stdlib: io_lib{_pretty}: Avoid tuple_to_list when possibleHans Bolinder
2018-04-25stdlib: Introduce characters limit of formatted stringsHans Bolinder
The name of the io_lib_pretty:print/2 option 'max_chars' is changed to 'line_max_chars' (used by module shell only). The new option for limiting the number of returned characters of io_lib_pretty:print() is called 'chars_limit'.
2018-04-25Merge branch 'hasse/stdlib/map_guards_shell/OTP-15035/ERL-613'Hans Bolinder
* hasse/stdlib/map_guards_shell/OTP-15035/ERL-613: erts: Correct abstract format doc regarding map creation stdlib: Correct the linter's check of map guard expressions
2018-04-25Merge pull request #1785 from richcarl/append-not-concatHans Bolinder
Do not use lists:concat where lists:append is intended
2018-04-25beam_validator: Clear X registers in wait_timeoutBjörn Gustavsson
Help us find more compiler bugs.
2018-04-25sys_core_fold: Eliminate crash for map update in guardBjörn Gustavsson
sys_core_fold would crash when attempting to optimize this code: t() when (#{})#{}-> c.
2018-04-25Merge branch 'map-get-bif' of git://github.com/michalmuskala/otpBjörn Gustavsson
* 'map-get-bif' of git://github.com/michalmuskala/otp: Introduce map_get guard-safe function OTP-15037
2018-04-25Merge pull request #1779 from ↵Ingela Andin
IngelaAndin/ingela/ssl/hello-pause/ERL-169/OTP-14372 Add new API functions to enable smoother user customizations based on TLS hello extensions
2018-04-24Merge pull request #1790 from jhogberg/john/erts/more-alloc-info/OTP-14961John Högberg
Improve memory instrumentation OTP-15024 OTP-14961
2018-04-24stdlib: Correct the linter's check of map guard expressionsHans Bolinder
The check is used by evaluating modules such as erl_eval. An example: "if map_size(#{}) =:= 0 -> ok end.".
2018-04-24Merge branch 'raimo/stdlib/gen_statem-dev/OTP-14015'Raimo Niskanen
* raimo/stdlib/gen_statem-dev/OTP-14015: Fix after feedback Improve pointer to User's Guide Fix after feedback on 'When to use' Add a 'When to use' section Fix timeout parsing and doc feedback Improve doc, change images to .svg erl_docgen: Implement width in image tag Update User's Guide and pointers to it Improve error reasons from state enter call
2018-04-24Merge branch 'maint'Hans Nilsson
* maint: Updated OTP version Prepare release ssh: Fix server crashes for exit-normal signals
2018-04-24Merge branch 'maint-18' into maintHans Nilsson
* maint-18: Updated OTP version Prepare release ssh: Fix server crashes for exit-normal signals Conflicts: OTP_VERSION lib/ssh/doc/src/notes.xml lib/ssh/src/ssh_connection_handler.erl lib/ssh/vsn.mk otp_versions.table
2018-04-24Introduce map_get guard-safe functionMichał Muskała
Rationale Today all compound data types except for maps can be deconstructed in guards. For tuples we have `element/2` and for lists `hd/1` and `tl/1`. Maps are completely opaque to guards. This means matching on maps can't be abstracted into macros, which is often done with repetitive guards. It also means that maps have to be always selected whole from ETS tables, even when only one field would be enough, which creates a potential efficiency issue. This PR introduces an `erlang:map_get/2` guard-safe function that allows extracting a map field in guard. An alternative to this function would be to introduce the syntax for extracting a value from a map that was planned in the original EEP: `Map#{Key}`. Even outside of guards, since this function is a guard-BIF it is more efficient than using `maps:get/2` (since it does not need to set up the stack), and more convenient from pattern matching on the map (compare: `#{key := Value} = Map, Value` to `map_get(key, Map)`). Performance considerations A common concern against adding this function is the notion that "guards have to be fast" and ideally execute in constant time. While there are some counterexamples (`length/1`), what is more important is the fact that adding those functions does not change in any way the time complexity of pattern matching - it's already possible to match on map fields today directly in patterns - adding this ability to guards will niether slow down or speed up the execution, it will only make certain programs more convenient to write. This first version is very naive and does not perform any optimizations.
2018-04-24Merge branch 'lukas/erl_docgen/add_github_contrib_link/OTP-14979'Lukas Larsson
* lukas/erl_docgen/add_github_contrib_link/OTP-14979: erl_docgen: Fix title link with '?'
2018-04-24Merge branch 'peterdmv/httpd_reload_config/ERL-578/OTP-15025'Péter Dimitrov
* peterdmv/httpd_reload_config/ERL-578/OTP-15025: inets: Fix httpd:reload_config/2 Change-Id: Ib02587ac75f7f9f4ce665c6ead54b5ab11560411
2018-04-24mikpe/erl_interface-bad-memset/PT-1796/OTP-15033Lukas Larsson
erl_interface: fix bad memset
2018-04-24Merge branch 'peterdmv/relative_path_script_alias/ERL-574/OTP-15021'Péter Dimitrov
* peterdmv/relative_path_script_alias/ERL-574/OTP-15021: inets: Fix handling of relative paths in script_alias Change-Id: I6874d37f538bde0e54276f2841dbb763e1d19ff6
2018-04-24ssl: Add new API functionsIngela Anderton Andin
2018-04-24ssl: Prepare to replace ssl:ssl_accept with ssl:handshakeIngela Anderton Andin
2018-04-23erl_docgen: Fix title link with '?'Lukas Larsson
2018-04-23Merge branch 'sverker/ets-cherries/OTP-15031'Sverker Eriksson
* sverker/ets-cherries/OTP-15031: erts: Use table ref for select continuation erts: Refactor erl_db_hash next() into next_live() erts: Change wrong alloc_fnf
2018-04-23erts: Rewrite memory instrumentationJohn Högberg
This commit replaces the old memory instrumentation with a new implementation that scans carriers instead of wrapping erts_alloc/erts_free. The old implementation could not extract information without halting the emulator, had considerable runtime overhead, and the memory maps it produced were noisy and lacked critical information. Since the new implementation walks through existing data structures there's no longer a need to start the emulator with special flags to get information about carrier utilization/fragmentation. Memory fragmentation is also easier to diagnose as it's presented on a per-carrier basis which eliminates the need to account for "holes" between mmap segments. To help track allocations, each allocation can now be tagged with what it is and who allocated it at the cost of one extra word per allocation. This is controlled on a per-allocator basis with the +M<S>atags option, and is enabled by default for binary_alloc and driver_alloc (which is also used by NIFs).
2018-04-23Merge branch 'hans/ssh/remove_dead_files/OTP-15028'Hans Nilsson
* hans/ssh/remove_dead_files/OTP-15028: ssh: Remove unused ssh_client_key.erl and ssh_server_key.erl
2018-04-23Prepare releaseErlang/OTP
2018-04-23inets: Fix httpd:reload_config/2Péter Dimitrov
- Add proper handling of path() as the first argument to httpd:reload_config/2. Change-Id: Ia5779bdd55bff974e8eb0dd16ef26edf1f52fcff
2018-04-21erl_interface: fix bad memsetMikael Pettersson
Compiling OTP-20.3.4 with GCC-7 generates the following warning: CC /tmp/otp_src_20.3.4/lib/erl_interface/obj.st/x86_64-unknown-linux-gnu/erl_marshal.o legacy/erl_marshal.c: In function 'erl_init_marshal': legacy/erl_marshal.c:110:5: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] memset(cmp_array, 0, CMP_ARRAY_SIZE); ^~~~~~ CMP_ARRAY_SIZE (256) is the number of elements in that array, but the elements are not char but enum, which is 4 bytes on e.g. x86-64. This results in 3/4 of the array not being correctly initialized. Idiomatic C is to pass sizeof cmp_array to memset(), so that's what I did.
2018-04-20erts: Use table ref for select continuationSverker Eriksson
and not the name. For more sane named table semantics. Applies to both select/1 continuation and trap context.
2018-04-20ssh: Remove unused ssh_client_key.erl and ssh_server_key.erlHans Nilsson
2018-04-20Merge pull request #1783 from bjorng/bjorn/deprecate-get_stacktrace/OTP-14692Björn Gustavsson
Deprecate erlang:get_stacktrace/1
2018-04-20Merge branch 'maint'Hans Nilsson
* maint: Updated OTP version Prepare release inets: Fix broken httpc options handling ssh: Fix server crashes for exit-normal signals ssh: Fix ssh_sftpd:handle_op not returning State Conflicts: OTP_VERSION
2018-04-20Merge branch 'maint-20' into maintHans Nilsson
* maint-20: Updated OTP version Prepare release erl_interface: Optimize latin1_to_utf8 and friend inets: Fix broken httpc options handling erl_interface: Fix ei_connect ssh: Fix server crashes for exit-normal signals ssh: Fix ssh_sftpd:handle_op not returning State ic: Optimize oe_ei_encode_atom