aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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-04Merge branch 'sverker/monitor-frenzy-fix'Sverker Eriksson
2018-04-04Merge pull request #1725 from michalmuskala/fun-literalsBjörn Gustavsson
Compile external fun expressions to literals OTP-15003
2018-03-29Merge branch 'lukas/erts/tcp_send_return_closed/OTP-15001'Lukas Larsson
* lukas/erts/tcp_send_return_closed/OTP-15001: erts: tcp send should return {error,closed}
2018-03-29Merge branch 'lukas/ei/fix_tmo_test'Lukas Larsson
* lukas/ei/fix_tmo_test: ei: Include stdlib.h to fix malloc usage in ei test
2018-03-29Merge pull request #1765 from peterdmv/split_inets/OTP-14113Péter Dimitrov
Split inets OTP-14113
2018-03-29Merge branch 'hans/ssh/dbg/OTP-14896'Hans Nilsson
* hans/ssh/dbg/OTP-14896: ssh: New test suite ssh_dbg_SUITE for testing ssh_dbg ssh: Use the new ssh_dbg module ssh: New ssh_dbg module ssh: Add ssh_connection_handler:alg/1 for test purposes ssh: Unused fields #ssh.hkey and #ssh.kex removed ssh: Simplify ssh_connection and ssh_connection_handler and their internal interfaces
2018-03-29ssh: New test suite ssh_dbg_SUITE for testing ssh_dbgHans Nilsson
2018-03-29ssh: Use the new ssh_dbg moduleHans Nilsson
2018-03-29ssh: New ssh_dbg moduleHans Nilsson
2018-03-29ssh: Add ssh_connection_handler:alg/1 for test purposesHans Nilsson
2018-03-29ssh: Unused fields #ssh.hkey and #ssh.kex removedHans Nilsson
2018-03-29ssh: Simplify ssh_connection and ssh_connection_handler and their internal ↵Hans Nilsson
interfaces
2018-03-29Merge branch 'hans/erl_docgen/datatype_title/OTP-15000'Hans Nilsson
* hans/erl_docgen/datatype_title/OTP-15000: erl_docgen: Add datatype-title tag to datatype tag
2018-03-29Merge branch 'ingela/ssl/DTLS-ECC'Ingela Anderton Andin
* ingela/ssl/DTLS-ECC: ssl: Cleaner test setup to avoid unintentional test case dependencies ssl: Correct ECC suite and DTLS ECC handling
2018-03-28erl_docgen: Add datatype-title tag to datatype tagHans Nilsson
2018-03-28ftp,tftp: Update initial version 1.0.0 -> 1.0Péter Dimitrov
Change-Id: I014b191da144c299d056eb155ed99ace710112b1
2018-03-28ftp,tftp: Add AUTHORS to ftp and tftpPéter Dimitrov
Change-Id: Ie0f52e82484462f8f7ec58c37ce16081af432797
2018-03-28tftp: Improve documentationPéter Dimitrov
Change-Id: Ie23a40e7159fe632cf5514ac617de17c5d5b5ce2
2018-03-28common_test: Remove dependency to inets ftpPéter Dimitrov
- Update ct_ftp to use the new FTP application. Change-Id: I84223107361132ea3144cdf7421738c4bebffa40
2018-03-28tftp: Add tests (app, appup, start_tftpd)Péter Dimitrov
Change-Id: I585ba5097632d460705257f03cb44adf8038f0be
2018-03-28inets: Fix inets:services()Péter Dimitrov
Change-Id: I20d44e771577b19060fbba0b2e83f64909c60faa
2018-03-28tftp: Fix dialyzer warningsPéter Dimitrov
Change-Id: Ie1e8a3fa458ee38a1c0b6a0f19e27e76c267688e
2018-03-28inets,tftp: Break out TFTP from inetsPéter Dimitrov
- Create directory structure - Move code, tests, documentation from inets - Add inets_tftp_wrapper - Add tftp app to run-dialyzer script Change-Id: I6a142ae66cecb9a1821cbf9ea6a45f66a836763d
2018-03-28ftp: Fix dialyzer warningsPéter Dimitrov
Change-Id: I695066755f8394619d5f231a1060e467f2c82edf
2018-03-28ftp: Add ftp app to run-dialyzer scriptPéter Dimitrov
Change-Id: Ie0a67ad22904ce9701f23bbf5573a182b4936790
2018-03-28ftp: Fix ftp test suitePéter Dimitrov
- vsftpd =< 3.0.2 does not support ECDHE ciphers and the ssl application removed ciphers with RSA key exchange from its default cipher list. To allow interoperability with old versions of vsftpd, cipher suites with RSA key exchange are appended to the default cipher list. - Fix regex in ftp.appup.src Change-Id: I53ce3b7f198ae95825eb0b5d39e94bdcebe78391
2018-03-28stdlib: Remove reference to inets:ftp in erl_tar.xmlPéter Dimitrov
Change-Id: I5328d5feeac3b7279a8770e8fc27e2d9e8eed359
2018-03-28inets: Fix broken link warningPéter Dimitrov
Change-Id: I9ec81e25d8135fa624554b5d011b2c554b3481d5
2018-03-28ftp: Update app.src filePéter Dimitrov
Change-Id: I4939a45cde292347975d8b870caeff15724046d2
2018-03-28inets: Fix missing anchor warningsPéter Dimitrov
Change-Id: Ifc3359b62e14b68320645f5d7c90bf1b9ccae016
2018-03-28ftp: Remove references to inetsPéter Dimitrov
Change-Id: I19bd2f1d4a35cbc5c233ebc8b2a9d52bbd37f047
2018-03-28ftp: Remove legacy tracing macrosPéter Dimitrov
Change-Id: Ie9cfc5902f3ec7f97df6f0764ff88b954139d87b
2018-03-28ftp: Refactor ftp testsPéter Dimitrov
- Add appup file - Update vsftpd configuration file with stronger cipher suites - Remove unused functions from ftp_test_lib - Improve certificate generation Change-Id: I941e922d7532a3f2a05662aff621a175b630d3b5
2018-03-28ftp: Add new test group 'ftp_sup'Péter Dimitrov
Change-Id: I3d3e09bf1f3fd6109cfb2cdd91e69fcd9554a3c9
2018-03-28inets: Support ftp stand_alone modePéter Dimitrov
Change-Id: I38bbca9d3fb2d90869cfe468e444204514301c36
2018-03-28ftp: Fix property testsPéter Dimitrov
Change-Id: I72c564ea25d7cc41716229369459ae68d8706007
2018-03-28inets,ftp: Break out FTP from inetsPéter Dimitrov
- Created initial directory structure for the FTP application. - Updated inets Makefiles to not include FTP related modules. - Remove ftp code from inets - Implement backward compatibility layer for FTP - Add inets_ftp_wrapper - Fix failing TCs Change-Id: I120ec5bdef0c3df4cee2d7880db2aec581505bc4
2018-03-28Merge branch 'sverker/driver-taints/OTP-14960'Sverker Eriksson
* sverker/driver-taints/OTP-14960: erts: Include foreign static linked drivers in taints erts: Fix harmless bug in macro IS_DRIVER_VERSION_GE erts: Remove our own NIF modules from "taints" erts: Refactor erts_static_nif_get_nif_init erts: Add dynamic loaded drivers to list of "taints"
2018-03-28erts: Fix race in nif_SUITE:monitor_frenzySverker Eriksson
detected by valgrind. We cannot compare monitor in state MON_FREE before it's initialized. Still not really kosher to access 'state' without lock or atomic-op.
2018-03-27Merge branch 'john/erts/bwt-wt-dirty-schedulers/OTP-14959'John Högberg
* john/erts/bwt-wt-dirty-schedulers/OTP-14959: Add +sbwt/+swt analogues for dirty schedulers
2018-03-27Merge branch 'dgud/observer/fix-config-bug/OTP-14993'Dan Gudmundsson
* dgud/observer/fix-config-bug/OTP-14993: Fix crash when config was wrong
2018-03-27Merge branch 'dgud/testcase-fixes'Dan Gudmundsson
* dgud/testcase-fixes: debug info add unicode opt env may contain unicode signs Fix lexemes conversion
2018-03-27Merge branch 'dgud/revert-string-depr'Dan Gudmundsson
* dgud/revert-string-depr: Revert "Deprecate old string functions"
2018-03-27ssl: Cleaner test setup to avoid unintentional test case dependenciesIngela Anderton Andin
2018-03-27ssl: Correct ECC suite and DTLS ECC handlingIngela Anderton Andin
When test handling was corrected it was obvious that DTLS ECC handling was not compleated.
2018-03-27Merge pull request #1760 from ↵John Högberg
jhogberg/john/erts/any-term-as-seq_trace-label/OTP-14899 Lift the type restrictions on seq_trace token labels
2018-03-26erts: Include foreign static linked drivers in taintsSverker Eriksson
That is, driver added with config option --enable-static-drivers.
2018-03-26erts: Fix harmless bug in macro IS_DRIVER_VERSION_GESverker Eriksson
harmless until we bump major version
2018-03-26Merge pull request #1761 from ↵Björn Gustavsson
bjorng/bjorn/compiler/fix-atom-leak/ERL-563/OTP-14968 Stop the compiler from overflowing the atom table