Age | Commit message (Collapse) | Author |
|
* hasse/stdlib/chars_limit_bug/OTP-15875/ERL-967:
stdlib: Fix a bug concerning io_lib option 'chars_limit'
# Conflicts:
# lib/stdlib/test/io_SUITE.erl
|
|
See also https://bugs.erlang.org/browse/ERL-967.
|
|
|
|
See also https://bugs.erlang.org/browse/ERL-957.
|
|
|
|
* raimo/stdlib/gen_statem-sync-timer-cancel/OTP-15295:
Rewrite to use synchronous timer cancel
|
|
|
|
|
|
Jumping around in a compressed file is nowhere near as cheap as
for uncompressed files, as it requires reading and decompressing
up until the desired position. Using read_ahead will improve
performance slightly.
|
|
|
|
Avoid traversing all of the list/string when only part of it will be
used. An explicit check that the list is flat is needed since
string:slice() accepts deep lists and more.
|
|
* hasse/stdlib/optimize_calendar_rfc3339/OTP-15630:
stdlib: Optimize calendar:system_time_to_rfc3339()
|
|
Not using io_lib for formatting makes the conversion several times
faster.
|
|
Long atom names in combination with <c><<>></c> could cause a crash.
|
|
* maint-21:
Updated OTP version
Prepare release
|
|
maint
* hasse/stdlib/optimize_pretty_print/ERIERL-306/OTP-15573:
Update primary bootstrap
stdlib: Optimize formatted printing of terms
|
|
|
|
Try calling iolist_size() before calling string:length().
The reason is that calls to string:length/1 are slow when the argument
is not a list of integers (or contains UNICODE).
|
|
* FNickRU/stdlib/optimize_calendar/PR-2121/OTP-15572:
Optimize calendar:gregorian_days_to_date/1
|
|
This patch improves the performance of calendar:gregorian_days_to_date/1
by changing the algorithm for finding the year to log-logarithmic.
The old implementation has linear complexity, which makes function
too slow for large values.
For example:
There is an API that allows you to create events for future dates.
There are users of this API who, for some reasons, choose dates
very far in the future. In such conditions, function works very slow.
New implementation based on interpolation search, takes 1 or 2
iterations at most cases and free from such a flaw.
A unit test was also developed to illustrate the speed of a function
at large values.
|
|
Fixes in erl_parse:abstract_type/0 type
|
|
Fix remote-call error in ms_transform
|
|
Add missing list wrapper.
|
|
`af_function_type()` already contains the `{'type', anno(), 'fun', ...}`
tuple so it does not have to be wrapped again.
|
|
This is allowed since 19.3 (commit 6d238032) and documented since commit
744fb920.
|
|
|
|
RFC3339 mentions in paragraph 5.1 that if certain conditions are
fulfilled, then sorting date and time strings results in a
time-ordered sequence. One of the conditions is that the strings must
have the same number of fractional second digits. This commits makes
sure this is indeed the case.
|
|
An external fun could inadvertently suppress warnings for
unused variables, such as in this example:
bug() ->
BugVar = foo(),
if true ->
fun m:f/1
end.
There would be no warning that `BugVar` was unused.
The bug was introduced in ff432e262e652, which was the commit
that extended external funs to allow variables.
https://bugs.erlang.org/browse/ERL-762
|
|
Before this patch the following call resulted in the below error
```
1> dbg:fun2ms(fun(_) -> m:f() end).
Error: Unknown error code {122,m,f}
```
Now it is properly formatted as
```
1> dbg:fun2ms(fun(_) -> m:f() end).
Error: fun containing the remote function call 'm:f/0' (called in body) cannot be translated into match_spec
```
|
|
The type `beam()` in the `beam_lib` module is confusing:
-type beam() :: module() | file:filename() | binary().
It says that the module name can be used to identify the BEAM module
to be accessed, but passing in the module name only works if the BEAM
file is located in the current working directory because the module
is not searched for in the code path.
The reason that it is allowed to pass in the module name as an atom is
for backward compatibility. A long time ago, atoms instead of strings
were used as filenames. For that reason, `filename` and `file` still
accept atoms as filenames (although the practice is frown
upon). `beam_lib` accepts an atom as the filename for the same reason.
To remove the confusion, remove `module()` from the type and the
mention of it in the documentation. Code that uses an atom as a
filename will still work, but Dialyzer will issue a warning.
https://bugs.erlang.org/browse/ERL-696
|
|
* john/compiler/deterministic-paths/OTP-15245/ERL-706:
compiler: Forward +source flag to epp and fix bug in +deterministic
epp: Allow user to set source name independently of input file name
|
|
Note that this does *not* affect -include()'d files or the -file()
directive.
|
|
Document bit_size in match-specs and allow in fun2ms
|
|
|
|
It is already allowed in match-specs.
|
|
As a consequence of some refactoring (OTP-14983, option
'chars_limit'), the Format argument of io_lib:format() no longer
accepts binaries in lists in Erlang/OTP 21.0.
Note that if Format is not of type io:format(), control sequences in
Format are ignored. This can result in unpredictable behaviour if, for
example, the output of io_lib:format() is used as Format: if the
output happens to be a string(), then control sequences are
interpreted, otherwise not.
A check that Format is of type io:format() will likely be introduced
in Erlang/OTP 22.0. That will probably mean work for some users, but
considering how unpredictable io_lib:format() is, we should try to fix
that.
|
|
|
|
The encoding option was introduced in commit
270d909696a753af022df72a404c73f2895b4a02, to allow report callbacks to
format according to a given encoding. There was, however, no
connection between this encoding option, and the encoding of the
device to which the logger handler was writing.
Since a formatter is defined to return unicode:chardata(), and in
order to avoid mismatch with the encoding of the device, the encoding
option is now removed from the formatter. The handler itself must make
sure that it does not write illegal data to its device.
|
|
It can also return errors and warnings.
|
|
uabboli/hb/stdlib/fix_dets_file_name/OTP-15253/ERL-555
stdlib: Let dets:open_file() crash when given raw file name
|
|
See also https://bugs.erlang.org/browse/ERL-667.
|
|
See also ERL-55 and OTP-13229.
|
|
|
|
|
|
Consider the following functions:
foo() -> bar(not_a_map).
bar(M) when not is_map_key(a, M) -> ok;
bar(_) -> error.
What will `foo/0` return? It depends. If the module is compiled
with the default compiler options, the return value will be
`ok`. If the module is compiled with the `inline` option,
the return value will be `error`.
The correct value is `error`, because the call to `is_map_key/2`
when the second argument is not a map should fail the entire
guard. That is the way other failing guards BIFs are handled.
For example:
foo() -> bar(not_a_tuple).
bar(T) when not element(1, T) -> ok;
bar(_) -> error.
`foo/0` always returns `error` (whether the code is inlined
or not).
This bug can be fixed by changing the classification of `is_map_key/2`
in the `erl_internal` module. It is now classified as a type test,
which is incorrect because type tests should not fail. Reclassifying
it as a plain guard BIF corrects the bug.
This correction also fixes the internal consistency check
failure which was reported in:
https://bugs.erlang.org/browse/ERL-699
|
|
* siri/logger/post-21/OTP-15132:
[logger] Allow setting kernel parameter 'logger_level' to 'all'
[kernel] Reduce risk of dead lock when terminating logger_sup
[logger] Fix regexp replacement for unicode strings
Update proc_lib:report_cb to obey logger formatter's size limiting params
[logger] Allow report callback with two arguments returning a string
Don't call report_cb from cth_log_redirect - formatter does that
Add legacy test of sasl_report_file_h and size limiting
[logger] Remove compiler warnings in test
[logger] Fix problem with test cases waiting for handler restart
[logger] Add ?LOG macro which takes Level as argument
[logger] Improve spec for set_handler_config/3 and set_primary_config/2
[logger] Generate .png file from .dia
[logger] Update documentation
|
|
|
|
* maint-21:
Updated OTP version
Update release notes
Update version numbers
Eliminate a crash in the beam_jump pass
stdlib: Fix a 'chars_limit' bug
Fix a race condition when generating async operation ids
Fix internal compiler error for map_get/2
beam_type: Fix unsafe optimization
public_key: Remove moduli 5121 and 7167 Thoose were added by 598629aeba9de98e8cdf5637043eb34e5d407751 but are not universaly supported.
|
|
Fix typo in erl_parse type unary_op()
|
|
|