Age | Commit message (Collapse) | Author |
|
* 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
|
|
Improve memory instrumentation
OTP-15024
OTP-14961
|
|
|
|
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.
|
|
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).
|
|
* john/erts/fix-sbwt-links:
Fix seealso tags for +sbwt/+swt
|
|
|
|
christhekeele/remove-trace-terms-from-table-types-in-match-docs
Remove trace-specific terms from docs for table-oriented matchspecs
|
|
This removes the matchspec instructions `is_seq_trace` and `get_tcw/0`
from the documentation for table-oriented matchspecs.
This is likely correct as both are already documented under "Functions
Allowed Only for Tracing", despite appearing in the list of possible
options for table specs.
The following observations further back this change up:
```erl
erlang:match_spec_test([whatever], [{'_', [], [{is_seq_trace}]}], trace).
%=> {ok,true,[],[]}
erlang:match_spec_test({whatever}, [{'_', [], [{is_seq_trace}]}], table).
%=> {error,[{error,"Special form 'is_seq_trace' used in wrong %dialect."}]}
erlang:match_spec_test([whatever], [{'_', [], [{get_tcw}]}], trace).
%=> {ok,true,[],[]}
erlang:match_spec_test({whatever}, [{'_', [], [{get_tcw}]}], table).
%=> {error,[{error,"Function get_tcw/0 cannot be called in this context."}]}
```
|
|
All functions, datatype and h3 headings have gotten a hover
attribute that shows a link directly to the edit page on
github for easy editing of documentation.
The github link links to the maint branch. An early attempt
was done to use the SHA of the current branch, but that did
not work well as github can only take pull requests from
branches.
|
|
In order to get line numbers into the ghlink we have to add a post
processing step for all xml files.
|
|
|
|
|
|
Sharing these settings for all schedulers can degrade performance,
so it makes sense to be able to configure them separately.
This also changes the default busy-wait time to "short" for both
kinds of dirty schedulers.
|
|
* john/erts/async-thread-defaults/OTP-14928:
Change default async thread count to 1
|
|
|
|
|
|
to conform with erl_nif.h
|
|
|
|
|
|
|
|
All uses of async threads in the built-in drivers have been
replaced with dirty IO, so it no longer makes sense to leave the
default at 10.
|
|
make erlang:process_info/1 not retrieve messages
|
|
Fix typos in erl_nif.xml
|
|
I was running this code in shell and expected it to take default `self()` meta tracer,
and start tracing `erlang:put/2`.
```
F = fun F() -> timer:sleep(5000), erlang:get(unique_field), erlang:put(unique_field, 123), F() end.
erlang:trace_pattern({erlang, put, 2}, [{['$1', '_'], [{'==', '$1', unique_field}], []}], [global]).
erlang:trace_pattern({erlang, get, 1}, [{['_'], [], [{trace, [], [call, timestamp]}]}], [meta]).
Pid = spawn(F).
```
But tracing didn't start:
```
6> flush().
Shell got {trace_ts,<0.70.0>,call,
{erlang,get,[unique_field]},
{1521,118606,753838}}
Shell got {trace_ts,<0.70.0>,call,
{erlang,get,[unique_field]},
{1521,118611,754798}}
Shell got {trace_ts,<0.70.0>,call,
{erlang,get,[unique_field]},
{1521,118616,755705}}
ok
7> erlang:trace_info(Pid, flags).
{flags,[]}
```
Turns out that I had false expectations, that `{trace, _, _}` would enable tracing on that process, inheriting meta tracer process as consumer of trace messages.
Instead it tried to take tracer from executing process (which is pointed out in docs). But there was none, so no tracing was started and flags were simply ignored (which is not that obvious from docs).
Updated docs to point out that there are cases when flags would be simply ignored, and no tracing would start.
|
|
Conflicts:
OTP_VERSION
|
|
Remove low memory need for HiPE on x86_64
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with link to ! operator
and clarify ugly badarg for unregistered atom argument.
|
|
to replace DFLAGS_STRICT_ORDER_DELIVERY
and remove that compile time dependency.
|
|
Attempt to make the system_info docs easier to navigate
by grouping items of similar themes together in the documentation.
|
|
|
|
While enif_make_binary will create heap-binaries from ErlNifBinaries
when possible now, enif_alloc_binary still allocates a Binary* off-heap
which is avoided entirely with enif_make_new_binary.
|
|
|
|
* maint:
Updated OTP version
Update release notes
Update version numbers
kernel: Add os:cmd/2 with max_size option
# Conflicts:
# OTP_VERSION
# lib/kernel/doc/src/os.xml
# lib/kernel/src/os.erl
|
|
* maint-20:
Updated OTP version
Update release notes
Update version numbers
erts: Add system_flags(erts_alloc,"+M?sbct *")
erts: Add age order first fit allocator strategies
erts: Refactor erl_ao_firstfit_alloc
erts: Add migration options "acnl" and "acfml"
kernel: Add os:cmd/2 with max_size option
erts: Add more stats for mbcs_pool
erts: Fix alloc_SUITE:migration
stdlib: Make ets_SUITE memory check try again
erts: Improve carrier pool search
erts: Improve alloc_SUITE:migration
erts: Refactor carrier dealloc migration
|
|
|
|
into 'sverker/master/alloc-n-migration/ERIERL-88'
|
|
into 'sverker/maint-20/alloc-n-migration/ERIERL-88'
OTP-14915
OTP-14916
OTP-14917
OTP-14918
|
|
to change sbct limit in runtime for chosen allocator type.
With great power comes great responsibility.
|
|
ageffcaoff: Age First Fit Carrier, Address Order First Fit (within carrier)
ageffcbf : Age First Fit Carrier, Best Fit (within carrier)
ageffcaobf: Age First Fit Carrier, Address Order Best Fit (within carrier)
Prefer old carriers, the older the better.
|
|
acnl: Abandon Carrier Nr Limit
acfml: Abandon Carrier Free block Min Limit
|
|
* hasse/no_get_stacktrace/OTP-14861:
erts: Update abstract format doc with stacktrace variable
wx: Do not call erlang:get_stacktrace()
tools: Do not call erlang:get_stacktrace()
stdlib: Do not call erlang:get_stacktrace()
sasl: Do not call erlang:get_stacktrace()
runtime_tools: Do not call erlang:get_stacktrace()
reltool: Do not call erlang:get_stacktrace()
parsetools: Do not call erlang:get_stacktrace()
observer: Do not call erlang:get_stacktrace()
mnesia: Do not call erlang:get_stacktrace() (cont)
mnesia: Do not call erlang:get_stacktrace()
kernel: Do not call erlang:get_stacktrace()
inets: Do not call erlang:get_stacktrace()
eunit: Do not call erlang:get_stacktrace()
et: Do not call erlang:get_stacktrace()
dialyzer: Do not call erlang:get_stacktrace()
debugger: Do not call erlang:get_stacktrace()
debugger: Do not try to restore stacktrace
common_test: Do not call erlang:get_stacktrace()
|