aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/code.erl
AgeCommit message (Collapse)Author
2015-06-04Avoid exception overhead if HiPE is disabledRichard Carlsson
2015-05-22code: Eliminate dialyzer warnings for unmatched returnsBjörn Gustavsson
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.
2015-05-13code: Correct type spec for code:make_stub_module/3Björn Gustavsson
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.
2015-05-07code: Make load_native_code_for_all_loaded/0 comply to specBjörn Gustavsson
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
2015-05-06code: Reduce overhead of native code checking for loaded modulesBjörn Gustavsson
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.
2013-05-06Fix unmatched_returns warnings in STDLIB and KernelHans Bolinder
2013-02-01Add a new function code:get_mode() can be used to detect how the code ↵Vlad Dumitrescu
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.
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-25Make adjustments for UnicodeHans Bolinder
2013-01-09kernel: Eliminate use of packages in code and code_serverBjörn Gustavsson
2012-07-18Merge branch 'maint'Henrik Nord
Conflicts: erts/preloaded/ebin/erl_prim_loader.beam lib/kernel/src/code.erl
2012-07-06[erts,kernel,stdlib] fix escript/primary archive reloadingTuncer Ayaz
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.
2012-01-27Move types and specs from erl_bif_types.erl to modulesHans Bolinder
2011-11-26code: Clean up loading of code_server prerequisitesBjörn Gustavsson
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.
2011-06-20Add more specs and typesHans Bolinder
An incorrect spec, rpc:yield/1, has been fixed.
2011-01-31Sanitize the specs of the code moduleKostis Sagonas
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.
2010-12-03Merge branch 'ks/erl_bif_types-cleanup/OTP-8961' into devPatrik Nyblom
* ks/erl_bif_types-cleanup/OTP-8961: Fix type information of 'file' and 'code' modules Conflicts: lib/hipe/cerl/erl_bif_types.erl
2010-11-30Corrected testcases broken by unicode filenamesPatrik Nyblom
Also corrected type-info for bifs
2010-11-29Fix type information of 'file' and 'code' modulesKostis Sagonas
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.
2010-07-28Load native code for modules loaded before the code serverPaul Guyot
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.
2010-06-03kernel: Add declaration for exported typesKostis Sagonas
2010-04-28kernel: Clean up as suggested by tidierKostis Sagonas
2010-04-19code:clash/0: match correct return value from erl_prim_loader:list_dir/1Tuncer Ayaz
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]>
2010-02-05Fix handling of archive (.ez) files in code:clash/0Tuncer Ayaz
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]>
2010-01-27OTP-8387 Explicit top directories in archive files are now optional.Håkan Mattsson
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.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP