aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
AgeCommit message (Collapse)Author
2015-05-20Merge branch 'richcarl/add-uptime-function'Henrik Nord
* richcarl/add-uptime-function: Add uptime() shell command OTP-12752
2015-05-19stdlib: Use lc to implement maps:map/2Björn-Egil Dahlberg
2015-05-19stdlib: Test maps:filter/2Björn-Egil Dahlberg
2015-05-18stdlib: Document maps:filter/2Björn-Egil Dahlberg
2015-05-18stdlib: Add maps:filter/2Björn-Egil Dahlberg
2015-05-18stdlib: Add gb_sets:iterator_fromHans Bolinder
2015-05-18stdlib: Add gb_trees:iterator_frombeaver
2015-05-14Speed up linting by not traversing filenames in erl_annoJosé Valim
Compilation on Erlang 18.0-rc2 is about 10% slower than in Erlang 17. After some debugging, we have noticed that linting is on average 30% to 50% slower being the main responsible for the performance reduction. Later profiling revealed is_filename/1 to be the biggest culprit. The change in this commit brings compilation times to about the same times as Erlang 17. Note this commit doesn't change the compiler behaviour compared to Erlang 17 because we didn't sanity check the value given to the file annotation in the past. I would say checking the filename is not worth it if it means compilation becomes 10% slower on average. After all, there are many places in the compiler where it will fail if we give it a malformed tree, I wouldn't then special case file annotation.
2015-05-14Cache nowarn_bif_clash functions in erl_lintJosé Valim
When compiling parser files, because they rely heavily on inline annotations, retrieving the nowarn_bif_clash information from the compiler options is expensive. This patch stores nowarn_bif_clash in the lint record. By using erlc +'{eprof,lint_module}' when compiling the erlang parser, we noticed the time spent on nowarn_function/2 reduced from 30% to 0.01%.
2015-05-13stdlib: Add 'sync' option to ets:tab2file/3Sverker Eriksson
to improve the chance of some real disk persistence before tab2file returns.
2015-05-13Revert "Prepare release"Henrik Nord
This reverts commit e09dd66dc4d89c62ddfd8c19791f9678d5d787c6.
2015-05-12Prepare releaseErlang/OTP
2015-05-12ssl: add ssl:connection_information/[1,2]Qijiang Fan
This commit adds a new function, ssl:connection_information/[1,2] to retrive the connection information from a SSLSocket. And also, this deprecates a function ssl:connection_info/1, and reimplements connection_info/1 with the new function.
2015-05-12Add uptime() shell commandRichard Carlsson
2015-05-11Merge branch 'kejv/export-digraph-label'Zandra Hird
* kejv/export-digraph-label: digraph: export label type
2015-05-11Merge branch 'egil/fix-maps-copy-shallow'Björn-Egil Dahlberg
* egil/fix-maps-copy-shallow: erts: Make hashmap_get halfword safe erts: Fix ETS db_has_variable check for large Maps stdlib: Strengthen ETS Maps tests erts: Fix copy shallow for large Maps stdlib: Strengthen ETS Maps tests erts: ETS ordered_set cannot use it's optimization with Maps stdlib: Strengthen ETS Maps tests stdlib: Refactor away ?line macro
2015-05-08digraph: export label typeDavid Kubecka
Together with vertex and edge, label is a core type of digraph module according to documentation and therefore should be exported as well.
2015-05-08Fixed a typo in Maps docBruce Yinhe
2015-05-08Delete superfluous comma from `filtermap' exampleAndras Horvath
The code explaining the behaviour of `filtermap/2` had a syntax error and wouldn't compile
2015-05-08Merge branch 'bjorn/stdlib/fix-filename-split/OTP-12716'Björn Gustavsson
* bjorn/stdlib/fix-filename-split/OTP-12716: Correct filename:split(<<"">>)
2015-05-08Merge branch 'dgud/stdlib/rand/OTP-12586'Dan Gudmundsson
* dgud/stdlib/rand/OTP-12586: stdlib: Document and add normal distributed random value function stdlib: Add new random functionality/module
2015-05-07stdlib: Strengthen ETS Maps testsBjörn-Egil Dahlberg
Ensure db_has_variable is tested for large Maps as well.
2015-05-07stdlib: Strengthen ETS Maps testsBjörn-Egil Dahlberg
Strengthen tests of large Maps in ETS.
2015-05-07stdlib: Strengthen ETS Maps testsBjörn-Egil Dahlberg
The additional tests in match_object focus on ordered sets.
2015-05-07stdlib: Refactor away ?line macroBjörn-Egil Dahlberg
2015-05-06Correct filename:split(<<"">>)Björn Gustavsson
filename:split("") returns [], while filename:split(<<"">>) returns [<<"/">>]. Since the support in the filename module for binary arguments is much more recent than support for strings, change filename:split(<<"">>) so that it returns []. Noticed-by: KOUCHANG
2015-05-04Merge branch 'peppe/jcl_mode_improvements'Peter Andersson
* peppe/jcl_mode_improvements: Fix problem with unitialized edlin text buffer Fix shell crash when in switch command mode OTP-12673
2015-04-30stdlib: Document and add normal distributed random value functionDan Gudmundsson
It is needed in various tests. It uses the Ziggurat algorithm, which is the fastest that I know.
2015-04-30Ensure that erl_anno is used when building the primary bootstrapBjörn Gustavsson
As the erl_anno module is used by the compiler, it must be included in the set of modules that are used when building the primary bootstrap.
2015-04-30stdlib: Silence some of qlc's warningsHans Bolinder
As long as the Erlang Compiler and qlc do not agree on the location of LC warnings, qlc's own warnings about patterns and filters that always fail have been silenced.
2015-04-30stdlib: Use module erl_annoHans Bolinder
2015-04-30stdlib: Add module erl_annoHans Bolinder
Introduce erl_anno, an abstraction of the second element of tokens and tuples in the abstract format. The convention that negative line numbers can be used for silencing compiler warnings will no longer work in OTP 19; instead the annotation 'generated' is to be used.
2015-04-29stdlib: Add new random functionality/moduleKenji Rikitake
The old random module contains an old algorithm which have flaws and the api requires the user to invoke seed and or checking if seed have been invoked, if a non constant seed is to be used. The api contains the following features: - The user can invoke rand:unform/[0|1] directly and get a non constant seeding. - The api is split in functional and non functional functions, i.e. usage of _s functions will not affect the process dictionary. - The api contains several algorithms with different characteristics and can be extended with new algorithms in the future. - Contains state of the art random number generators. - Default algorithm is taylor made for erlang to be fast on 64bits machines.
2015-04-27Merge branch 'derek121/gen_server_doc_grammar'Zandra Hird
* derek121/gen_server_doc_grammar: Fix grammar in docs for multi_call/*
2015-04-27Merge branch 'bjorn/use-monotonic-time'Björn Gustavsson
* bjorn/use-monotonic-time: supervisor: Correct restart handling test_server: Use erlang:monotonic_time/0 compile: Teach 'time' option to show three significant decimals timer: Use monotonic_time/0 in tc/1,2,3
2015-04-27stdlib: Substitute set() for gb_sets:set() in gb_setsHans Bolinder
2015-04-22supervisor: Correct restart handlingBjörn Gustavsson
fbaa0bec replaced the use of now/0 with erlang:monotonic_time/1 but at the same time introduced a bug in inPeriod/3 so that it would always return 'true' (the subtraction Time - Now would always result in a non-positive number that would always be less than Period). The symptoms of the bug is that when a child has been restarted the maximum number of times allowed, the supervisor will terminate, regardless of how much time that elapses between the restarts. There was no test case that detected this problem. Add the missing test case to ensure that this bug stays killed. Reported-by: Rafał Studnicki
2015-04-22Fix problem with unitialized edlin text bufferPeter Andersson
Also make it possible to copy text buffer from current group process to the JCL mode
2015-04-22Merge branch 'bjorn/compiler/eprof'Björn Gustavsson
* bjorn/compiler/eprof: v3_life: Optimize updating of the variable data base beam_jump: Replace use of lists:dropwhile/2 with a custom function beam_asm: Eliminate unnecessary use of iolist_to_binary/1 beam_bsm: Optimize btb_index() beam_type: Eliminate redundant calls to checkerror_1/2 erl_expand_records: Simplify handling of call_ext instructions beam_utils: Optimize index_labels_1/2 beam_block: Optimize matching of binary literals Move rewriting of bs_match from beam_clean to beam_z v3_codegen: Reduce cost for fixing up bs_match_string instructions v3_codegen: Optimize "turning" of y registers v3_kernel: Optimize subst_vsub/3 orddict: Eliminate unnecessary consing in store/3 and others compile: Add the {eprof,Pass} option for easy eprof running compile: Eliminate unnecessary wrappers for compiler passes Add z_SUITE to validate loaded code test suite: Always place .core files in data directories test suites: Unload modules compiled from .core or .S compilation_SUITE: Unload tested modules using the code server
2015-04-22erl_expand_records: Simplify handling of call_ext instructionsBjörn Gustavsson
The erl_expand_records module have inherited code from sys_pre_expand. We can simplify the code for handling the call_ext instruction to make the code clearer and a smidge faster.
2015-04-22orddict: Eliminate unnecessary consing in store/3 and othersBjörn Gustavsson
As a minor optimization, eliminate unnecessary cons operations in store/3, append/3, append_list/3, update/4, and update_counter/3.
2015-04-21Merge branch 'zandra/fix-ssl-obsolete-arity'Zandra Hird
* zandra/fix-ssl-obsolete-arity: add arity to obsolete_1(ssl, negotiated_next_protocol, 1)
2015-04-20timer: Use monotonic_time/0 in tc/1,2,3Björn Gustavsson
2015-04-20Merge branch 'wmalik/slave-specs'Björn Gustavsson
* wmalik/slave-specs: Remove unused comments Fix Host and Name type in slave.erl
2015-04-20zip: Suppress a dialyzer warning for an unmatched returnBjörn Gustavsson
A warning for an unmatched return was introduced in aaa7c917. The caller of openzip_close/1 ignores the return value, which could be an error tuple. In this situation, handling a fatal error, it is OK to ignore the return value; thus, we only need to make it explicit that we are ignoring the return value.
2015-04-16Merge branch 'bjorn/maps'Björn Gustavsson
* bjorn/maps: Document the new {badmap,Term} and {badkey,Key} exceptions Raise more descriptive error messages for failed map operations erl_term.h: Add is_not_map() macro Tigthen code for the i_get_map_elements/3 instruction Pre-compute hash values for the general get_map_elements instruction Teach the loader to pre-compute the hash value for single-key lookups Optimize use of i_get_map_element/4 beam_emu: Slightly optimize update_map_{assoc,exact} v3_codegen: Don't sort map keys in map creation/update beam_validator: No longer require strict literal term order Sort maps keys in the loader De-optimize the has_map_fields instructions erts/map_SUITE.erl: Add a test case that tests has_map_fields Fully evaluate is_map/1 for literals at load-time map_SUITE: Add tests of is_map/1 with literal maps Run a clone of map_SUITE without optimizations Remove the fail label operand of the new_map instruction Correct transformation of put_map_assoc to new_map Remove support for put_map_exact without a source map
2015-04-15Document the new {badmap,Term} and {badkey,Key} exceptionsBjörn Gustavsson
2015-04-15Raise more descriptive error messages for failed map operationsBjörn Gustavsson
According to EEP-43 for maps, a 'badmap' exception should be generated when an attempt is made to update non-map term such as: <<>>#{a=>42} That was not implemented in the OTP 17. José Valim suggested that we should take the opportunity to improve the errors coming from map operations: http://erlang.org/pipermail/erlang-questions/2015-February/083588.html This commit implement better errors from map operations similar to his suggestion. When a map update operation (Map#{...}) or a BIF that expects a map is given a non-map term, the exception will be: {badmap,Term} This kind of exception is similar to the {badfun,Term} exception from operations that expect a fun. When a map operation requires a key that is not present in a map, the following exception will be raised: {badkey,Key} José Valim suggested that the exception should be {badkey,Key,Map}. We decided not to do that because the map could potentially be huge and cause problems if the error propagated through links to other processes. For BIFs, it could be argued that the exceptions could be simply 'badmap' and 'badkey', because the bad map and bad key can be found in the argument list for the BIF in the stack backtrace. However, for the map update operation (Map#{...}), the bad map or bad key will not be included in the stack backtrace, so that information must be included in the exception reason itself. For consistency, the BIFs should raise the same exceptions as update operation. If more than one key is missing, it is undefined which of keys that will be reported in the {badkey,Key} exception.
2015-04-14Fix grammar in docs for multi_call/*Derek Brown
2015-04-14Merge branch 'egil/fix-maps-module-exceptions/OTP-12657'Björn-Egil Dahlberg
* egil/fix-maps-module-exceptions/OTP-12657: stdlib: Correct maps module exceptions upon errors