Age | Commit message (Collapse) | Author |
|
|
|
We want to have the core applications of Erlang/OTP free from any
dialyzer warnings. Eliminate the warnings for unmatched returns
that were introduced in 7309ff4c3832.
|
|
e47490f83e561a changed the size of Info argument tuple (third argument)
for code:make_stub_module/3 from 2 to 3, but did not update the
spec in code.erl.
|
|
7309ff4c38325 introduced a mismatch between
load_native_code_for_all_loaded/0 and its spec. We could just delete
spec, but it is cleaner to ensure that the function always returns
'ok'.
Noticed-by: Tuncer Ayaz
|
|
When the code server has been started, the function
load_native_code_for_all_loaded/0 will check whether the .beam
files for all loaded modules contain any native code. If there
is native code, it will be loaded.
If there is no native code, on my computer the check will take about
10 ms. That time can be reduced to about 2 ms if we replace the call
to code beam_lib:chunks/2 with a call to prim_file:read_file/1 to read
the file and a call to code:get_chunk/2 to check whether the chunk for
native code is present.
Furthermore, the entire check can be spawned off to a separate
process and done in parallel with OTP starting up.
|
|
|
|
servers behaves
Rationale:
Some applications (like erlide) have code to be loaded dynamically on a
node. It may be slow to load everything upfront every time, so if the
node is in interactive mode, we would like to just append to the load
path. Currently, there is no direct way to detect if the node is running
in embedded mode or not so that we can do the right thing.
|
|
|
|
|
|
|
|
Conflicts:
erts/preloaded/ebin/erl_prim_loader.beam
lib/kernel/src/code.erl
|
|
If the mtime of an escript/primary archive file changes after being
added to the code path, correctly reload the archive and update the
cache.
The existing code didn't consider that it might be a zip archive and failed:
=ERROR REPORT==== 3-Aug-2011::09:21:21 ===
File operation error: bad_central_directory. Target:
/escript_archive/module.beam. Function: get_file. Process: code_server.
Thanks David Reid and Hakan Mattson.
|
|
|
|
Reorganize in a systematic way the code that loads the modules needed
by the code_server process. While at it, remove the useless
hipe_unified_loader:load_hipe_modules/0 function.
|
|
An incorrect spec, rpc:yield/1, has been fixed.
|
|
After the addition of unicode_binary() to the file:filename() type,
dialyzer started complaining about erroneous or incomplete specs in some
functions of the 'code' module. The culprit was hard-coded information
in erl_bif_types for functions of this module, which were not updated.
Since these functions have proper specs these days and code duplication
(pun intended) is never a good idea, their type information was removed
from erl_bif_types.
While doing this, some erroneous comments were fixed in the code module
and also made sure that the code now runs without dialyzer warnings even
when the -Wunmatched_returns option is used.
Some cleanups were applied to erl_bif_types too.
|
|
* ks/erl_bif_types-cleanup/OTP-8961:
Fix type information of 'file' and 'code' modules
Conflicts:
lib/hipe/cerl/erl_bif_types.erl
|
|
Also corrected type-info for bifs
|
|
Dialyzer for a long time now has had hard-coded type information about
key functions of the 'file' and 'code' modules in 'erl_bif_types'.
Some of this information was not up-to-date according to the published
Erlang/OTP documentation, while some other part contained small errors.
Now that specs are available, this information should be moved to the
corresponding files, not be hard-coded in erl_bif_types.
This change takes out all information for the 'file' module and fixes
some small errors in type information for the 'code' module.
|
|
When configuring erlang with --enable-native-libs, some core modules are
compiled with hipe, yet because they are loaded before the code server,
their native code is not loaded. The fix consists in quietly trying to
load the native code for all loaded modules just after the code server
is started.
|
|
|
|
|
|
erl_prim_loader:list_dir/1 returns error on failure and not
{error,_}.
Also update tests in code_SUITE:clash/1.
Defect was introduced with fix for listing .ez archives in 49da83de4b.
Initial code:clash/0 tests added in 79194d5fa7.
Signed-off-by: Tuncer Ayaz <[email protected]>
|
|
code:clash/0 did not take into account .ez files
when listing contents of code path entries.
Using erl_prim_loader:list_dir/1 instead of
file:list_dir/1 fixes the problem.
Signed-off-by: Tuncer Ayaz <[email protected]>
|
|
For example, if an archive (app-vsn.ez) just contains an
app-vsn/ebin/mod.beam file, the file info for the app-vsn and
app-vsn/ebin directories are faked using the file info from the
archive file as origin. The virtual direcories can also be
listed. For short, the top directories are virtual if they does
not exist.
|
|
|