diff options
author | Björn Gustavsson <[email protected]> | 2019-02-21 09:31:56 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-02-21 09:31:56 +0100 |
commit | 8305e0f2db8e4aee1fb7be7675f31d4f1f4ea624 (patch) | |
tree | a0da956c4d765fb0dd6d6295f0f77bde65a2f5da /lib/compiler/src/erl_bifs.erl | |
parent | d1c00c691422bd43f007a68458347694d231dd0a (diff) | |
parent | 02de9d7de92298e807a0eef4816b36eab825e63a (diff) | |
download | otp-8305e0f2db8e4aee1fb7be7675f31d4f1f4ea624.tar.gz otp-8305e0f2db8e4aee1fb7be7675f31d4f1f4ea624.tar.bz2 otp-8305e0f2db8e4aee1fb7be7675f31d4f1f4ea624.zip |
Merge pull request #2149 from bjorng/bjorn/compiler/misc
Miscellaneous compiler improvements
Diffstat (limited to 'lib/compiler/src/erl_bifs.erl')
-rw-r--r-- | lib/compiler/src/erl_bifs.erl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/compiler/src/erl_bifs.erl b/lib/compiler/src/erl_bifs.erl index d925decce6..94a5dfe012 100644 --- a/lib/compiler/src/erl_bifs.erl +++ b/lib/compiler/src/erl_bifs.erl @@ -32,6 +32,22 @@ %% Returns `true' if the function `Module:Name/Arity' does not %% affect the state, nor depend on the state, although its %% evaluation is not guaranteed to complete normally for all input. +%% +%% NOTE: There is no need to include every new pure BIF +%% here. Including it here means that the value of the function +%% will be evaluated at compile-time if the arguments are +%% constant. If that optimization is not useful/desired, there is +%% no need to include the new BIF here. +%% +%% Functions whose return value could conceivably change in a +%% future version of the runtime system must NOT be included here. +%% +%% Here are some example of functions that should not be +%% included: `term_to_binary/1', hashing functions, non-trivial +%% encode/decode functions. +%% +%% When unsure whether a new BIF should be included here, the +%% conservative safe choice is NOT to include it. -spec is_pure(atom(), atom(), arity()) -> boolean(). |