Age | Commit message (Collapse) | Author |
|
erl_prim_loader:get_files/2 was an optimization introduced before the
SMP emulator (that is, before R11). The idea was to use the async
threads in the efile driver to read multiple BEAM files from the disk
in parallel.
In a modern computer with the SMP emulator, loading a BEAM module
seems to be more time-consuming than reading it from disk. To optimize
loading we would need to load several modules in parallel. We could
modify get_files/2 so that it would support parallel loading, but it
is cleaner to first remove get_files/2 and then (in a future commit),
introduce new functions to support parallel loading.
|
|
|
|
The deep indentation makes loop/3 difficult to read and maintain.
Break out the request handling code into a separate function.
|
|
Kostis Sagonas pointed out that there is a dialyzer warning
for constructing an improper list in the following clause:
translate_response(?FILE_RESP_N2DATA = X,
[<<_:64, _:64, _:64>> | <<>>] = Data) ->
{error, {bad_response_from_port, [X | Data]}};
I don't want to change the code to somehow eliminate the warning. An
improper list has already been constructed in the efile driver itself,
and that would be difficult to fix.
Therefore, tell dialyzer to ignore warnings for improper lists
in translate_response/2.
|
|
The compact wall of arguments makes it hard to see what is actually
happening in eval_script().
Collect the arguments into a record.
|
|
Expansion of $ROOT in paths are handled specially compared to boot
variables. There is no reason $ROOT can't be handled as a boot
variable.
We can simplify the expansion of boot variables if we spend a little
extra effort upfront collecting all boot variables into a map.
Make the error checking for -boot_var arguments stricter. Only allow
-boot_var followed by exactly two arguments to help users catch
errors earlier.
|
|
The last clause in start_it/1 calls a function in some module.
It goes to great length to catch any exception and pass them on
unchanged, and if there was a normal return, it will just return
the return value. It can been seen that the entire 'catch'
construction with the reference trick is totally unnecessary.
|
|
The get_flag/3 function which returns a default value if the
flag doesn't exist, is implemented in terms of get_flag/2
which throws an exception if the flag doesn't exist.
get_flag/3 is frequently used for the flags that don't exist,
which means that means that an exception will be generated and
catched for no good reason.
Reimplement get_flag/3 so that it doesn't have to call get_flag/2
and catch an exception. Eliminate the get_flag/2 function by
writing a special purpose function for the only time it's used,
that is for retrieving the value for the -root flag. As a
side-effect, we will get a nicer error message if there is
something wrong with the -root flag.
Similarly, simplify get_flag_list/3 and remove get_flag_list/2.
We can also eliminate search/3 and use the lists:keyfind/3
BIF instead.
|
|
The handling of flags has been incrementally messed up over
time, leading to convoluted code. Rewrite the parsing and
lookup of flags. By using the appropriate data structures,
the code will become simpler.
|
|
* lukas/erts/forker: (28 commits)
erts: Never abort in the forked child
erts: Mend ASSERT makro for erl_child_setup
erts: Allow enomem failures in port_SUITE
erts: iter_port sleep longer on freebsd
erts: Allow one dangling fd if there is a gethost port
erts: Only use forker StackAck on freebsd
erts: It is not possible to exit the forker driver
erts: Add forker StartAck for port start flowcontrol
erts: Fix large open_port arg segfault for win32
erts: Fix memory leak at async open port
kernel: Remove cmd server for unix os:cmd
erts: Add testcase for huge port environment
erts: Move os_pid to port hash to child setup
erts: Handle all EINTR and EAGAIN cases in child setup
erts: Make child_setup work with large environments
erts: Fix forker driver ifdefs for win32
erts: Fix uds socket handling for os x
erts: Fix dereferencing of unaligned integer for sparc
erts: Flatten too long io vectors in uds write
erts: Add fd count test for spawn_driver
...
Conflicts:
erts/emulator/beam/erl_node_tables.c
erts/preloaded/src/erts_internal.erl
|
|
OTP-13086
|
|
* egil/term_type/OTP-13172:
Test erts_internal:term_type/1
erts: Let term_type/1 encompass all types
erts: Change erts_internal:map_type/1 into term_type/1
|
|
* rickard/ohmq-fixup/OTP-13047:
Replace off_heap_message_queue option with message_queue_data option
Always use literal_alloc
Distinguish between GC disabled by BIFs and other disabled GC
Fix process_info(_, off_heap_message_queue)
Off heap message queue test suite
Remove unused variable
Fix memory leaks
|
|
The message_queue_data option can have the values
- off_heap
- on_heap
- mixed
|
|
|
|
to support other terms, not just maps
|
|
* np/sharing-preserved-copy/OTP-12590: (28 commits)
Refactor have seq_trace token test
Use sharing preserving copy error messages and exceptions
Use sharing preserving copy in enif_make_copy
Refactor sharing preserved copy flags
Fix rebase of SHCOPY seq_tokens
Fix erts_debug:copy_shared/1 prototype
Update preloaded module erlang.beam
Add erlang:copy_literals/2 spec
Add copy_literals testcase
Do not use GCC extensions in copy
Use copy literal range check in message passing and purging
Add BIF for setting internal copy literal range
Copy literals in copy sharing
Refactor copy sharing
Add support for HAMT maps in preserved copy
Fix Map preserved sharing copy implementation
Fix Halfword removal
Fix internal stacks
Add support for maps in preserved copy
Add --enable-sharing-preserving configure flag
...
|
|
|
|
* lrascao/fix/vm_crash_on_init_restart:
Fix crash on init restart
OTP-13115
|
|
|
|
This info request returns greater details about the current
gc state. This info is not included in the default process_info/1
as it would clutter the default printout with too much information.
|
|
|
|
* c-rack/fix-typo-prim-inet:
Fix minor typo "timout" -> "timeout"
|
|
* rickard/ohmq/OTP-13047:
Fragmented young heap generation and off_heap_message_queue option
Refactor GC
Introduce literal tag
Conflicts:
erts/doc/src/erlang.xml
erts/emulator/beam/erl_gc.c
|
|
* The youngest generation of the heap can now consist of multiple
blocks. Heap fragments and message fragments are added to the
youngest generation when needed without triggering a GC. After
a GC the youngest generation is contained in one single block.
* The off_heap_message_queue process flag has been added. When
enabled all message data in the queue is kept off heap. When
a message is selected from the queue, the message fragment (or
heap fragment) containing the actual message is attached to the
youngest generation. Messages stored off heap is not part of GC.
|
|
On load handler process not being launched on a restart, NIF's
such as asn1rt_nif require it to be present for correct loading.
|
|
* lucafavatella/dialyzer-fun-literal-arity:
Teach Dialyzer arity of funs with literal arity
OTP-13068
|
|
A new {line_delimiter, byte()} option allows line-oriented TCP-based
protocols to use a custom line delimiting character. It is to be
used in conjunction with {packet, line}.
This option also works with erlang:decode_packet/3 when its first argument
is 'line'.
|
|
|
|
|
|
Re-insert logic for `erlang:make_fun/3` in `erl_bif_types`. It had
been removed in bd941f5 while type spec-ing `erlang.erl`. Type spec in
`erlang.erl` cannot express arity of returned fun based on value of
argument hence re-introducing logic in `erl_bif_types`.
Re-definition of logic in `erl_bif_types` follows approach in 9d870a0.
|
|
|
|
* rickard/io-bytes/OTP-12842:
Save IO bytes in scheduler specific data
|
|
* nybek/fix_so_linger_zero__simple:
Update prim_inet.beam
Fix socket option {linger, {true, 0}} to abort TCP connections
Apply 'show_econnreset' socket option to send errors as well
Add 'show_econnreset' TCP socket option
|
|
|
|
* rickard/delayed-delete-node/OTP-12802:
Delayed node table GC
|
|
* rickard/timer-improvement/OTP-12650:
Callback timer
Disable accessor timer option
Aux work flag descriptions
Fix test cases
|
|
|
|
Up until now, if {linger, {true, 0}} is set on the socket and there is
data in the port driver queue, the connection is not aborted until
the port queue is empty and close() is called on the underlying file
descriptor. This bug allows an idle TCP client to prevent a server
from terminating the connection and freeing resources. This patch
fixes the problem by discarding the port queue if the socket is closed
when {linger, {true, 0}} is set.
|
|
An ECONNRESET is a socket error which tells us that a TCP peer has sent
an RST. The RST indicates that they have aborted the connection and
that the payload we have received should not be considered complete. Up
until now, the implementation of TCP in inet_drv.c has hidden the
receipt of the RST from the user, treating it as though it was just
a FIN terminating the read side of the socket.
There are many cases where user code needs to be able to distinguish
between a socket that was closed normally and one that was aborted.
Setting the option {show_econnreset, true} enables the user to receive
ECONNRESET errors on both active and passive sockets.
A connected socket returned from gen_tcp:accept/1 will inherit the
show_econnreset setting of the listening socket.
By default this option is set to {show_econnreset, false}.
Note that this patch only enables the reporting of ECONNRESET when
the socket is being read from. It does not report ECONNRESET (or
EPIPE) when the user tries to write to a connection when an RST
has already been received. Currently the TCP implementation in
inet_drv.c hides all such send errors from the user in favour
of returning {error, close}. A separate patch will be needed to
enable the reporting of such errors.
|
|
|
|
OTP-12797
|
|
|
|
If the driver queue is empty, or the user is requesting a 'read'
shutdown, then the shutdown() syscall is performed synchronously, as
per the old version of shutdown/2.
However, if the user is requesting a 'write' or 'read_write' shutdown,
and there is data in the driver queue for the socket, then the
shutdown() syscall is delayed and handled asynchronously when the
driver queue is written out.
This version of shutdown solves a number of issues with the old
version. The two main solutions it offers are:
* It doesn't block when the TCP peer is idle or slow. This is the
expected behaviour when shutdown() is called: the caller needs
to be able to continue reading from the socket, not be prevented
from doing so.
* It doesn't truncate the output. The current version of
gen_tcp:shutdown/2 will truncate any outbound data in the driver
queue after about 10 seconds if the TCP peer is idle of slow. Worse
yet, it doesn't even inform anyone that the data has been
truncated: 'ok' is returned to the caller; and a FIN rather than
an RST is sent to the TCP peer.
For a detailed description of all the problems with the old version
of shutdown, please see the EEP Light that was written to justify
this patch.
|
|
* rickard/timer-optimization/OTP-12650:
Timer fixes, documentation, and test cases
Conflicts:
erts/emulator/beam/erl_hl_timer.c
|
|
|
|
* rickard/timer-optimization/OTP-12650:
Optimized timer implementation
Reusable red-black tree implementation
Conflicts:
erts/emulator/beam/erl_bif_timer.c
|
|
|
|
|
|
* rickard/time_api/OTP-11997:
Misc fixes
Conflicts:
erts/preloaded/ebin/erlang.beam
erts/preloaded/ebin/erts_internal.beam
|