Age | Commit message (Collapse) | Author |
|
by using a cooperative strategy that will make
any process accessing the table execute delelete_all_objects_continue
until the table is empty.
This is not an optimal solution as concurrent threads will still
block on the table lock, but at least thread progress is made.
|
|
I had missed the one in lower section.
|
|
Update global name typespec
|
|
Introduce is_map_key/2 guard BIF
OTP-15037
|
|
Add a new pre-defined macro called OTP_RELEASE that will expand
to an integer being the OTP version. Thus, in OTP 19 the value will
be the integer 19.
The OTP_RELEASE macro is particularly useful in order to have
different source code depending on new language features or new
features in the type specification syntax. Those features are only
introduced in major versions of OTP.
To be truly useful, the -if preprocessor directive need to be
implemented. That is the purpose of the next commit.
Code that will need to work in both OTP 18 and OTP 19 can be
structured in the following way:
-ifdef(OTP_RELEASE).
%% Code that only works in OTP 19 and later.
-else.
%% Code that will work in OTP 18.
-endif.
|
|
|
|
|
|
|
|
|
|
|
|
This replaces all uses of lib:progname/0 in tests.
|
|
|
|
|
|
|
|
|
|
This reverts commit 202bb737e3deabfebee683266f4b7c42781eb521.
|
|
This reverts commit 345f7f527a4c26ef49cef0d81e2c8b71bf01ebc3.
|
|
|
|
|
|
This complements the `map_get/2` guard BIF introduced in #1784.
Rationale.
`map_get/2` allows accessing map fields in guards, but it might be
problematic in more complex guard expressions, for example:
foo(X) when map_get(a, X) =:= 1 or is_list(X) -> ...
The `is_list/1` part of the guard could never succeed since the
`map_get/2` guard would fail the whole guard expression. In this
situation, this could be solved by using `;` instead of `or` to separate
the guards, but it is not possible in every case.
To solve this situation, this PR proposes a `is_map_key/2` guard that
allows to check if a map has key inside a guard before trying to access
that key. When combined with `is_map/1` this allows to construct a
purely boolean guard expression testing a value of a key in a map.
Implementation.
Given the use case motivating the introduction of this function, the PR
contains compiler optimisations that produce optimial code for the
following guard expression:
foo(X) when is_map(X) and is_map_key(a, X) and map_get(a, X) =:= 1 -> ok;
foo(_) -> error.
Given all three tests share the failure label, the `is_map_key/2` and
`is_map/2` tests are optimised away.
As with `map_get/2` the `is_map_key/2` BIF is allowed in match specs.
|
|
|
|
* siri/kernel/logger/OTP-13295:
Add documentation of the built-in logger handlers
Catch badarg in logger:get_format_depth/0
Add chars_limit option to logger_formatter
Don't kill logger process until all other processes are dead
Set call timeout for logger_server to infinity
Update primary bootstrap
Test cuddle for logger
Update cth_log_redirect to a logger handler
Start using logger internally in kernel and stdlib
Remove error_logger process and add logger process
Add logger
|
|
* hasse/stdlib/rfc3339_datetime/OTP-14764:
stdlib: Add RFC 3339 functions to module calendar
|
|
|
|
Allow installing multiple instances of sys debug function
This commit solves a bug which allowed installing {Fun,State} as sys debug function even if Fun was already installed. This happened in the case when the current State of the debug fun was undefined.
Also, the new format {Id,Fun,State} of debug functions can be installed, allowing multiple instances of the same fun.
|
|
[stdlib/sys.erl] Fix sys module's debug statistics not including the out message count when using gen_server:call/2.
OTP-15047
|
|
Functions for converting between RFC 3339 strings and system time
are added.
Options are lists, but we are considering using maps instead. If we
change, it will happen after Erlang/OTP 21.0-rc1 is released.
|
|
* hasse/stdlib/calendar_systemtime/OTP-13413:
stdlib: Add system time functions to module calendar
|
|
|
|
|
|
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.
|
|
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.
|
|
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).
|
|
|
|
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'.
|
|
* 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
|
|
* 'map-get-bif' of git://github.com/michalmuskala/otp:
Introduce map_get guard-safe function
OTP-15037
|
|
The check is used by evaluating modules such as erl_eval.
An example: "if map_size(#{}) =:= 0 -> ok end.".
|
|
* 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
|
|
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.
|
|
Currently, in sys:stat/2, the message out only count for system events with format
{out, Msg, To}. However, the gen_server:reply/5 will call sys:handle_debug/4
with format {out, Reply, To, State}. That will make the message out count fail
to pattern matching.
Also update sys_SUITE.erl and relevant docs.
|
|
|
|
and not the name. For more sane named table semantics.
Applies to both select/1 continuation and trap context.
|
|
Deprecate erlang:get_stacktrace/1
|
|
|
|
|
|
Those warnings don't make sense any more since erlang:get_stacktrace/0
is now deprecated.
|
|
|
|
for erts, stdlib, kernel and runtime_tools.
|
|
|