# `CredoHotUpgrades.Check.NoNif`
[🔗](https://github.com/deployex/credo_hot_upgrades/blob/main/lib/credo_hot_upgrades/check/no_nif.ex#L1)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

This check has a base priority of `high` and works with any version of Elixir.

## Explanation

A module that calls `:erlang.load_nif/2` brings native code into the VM
outside the normal code path. Replacing it in a running node has rules of
its own: a new version of the module loads the shared object again, and
that load fails with `on_load_failure` unless the library implements the
`upgrade` callback, which few do. Inside a release upgrade that failure
comes after the point of no return, the node restarts on the old release
with everything its processes held gone.

This check flags every module that loads a NIF, as a reminder to compare
the module and the shared object between the two releases before deciding
whether this one can be hot-upgraded at all. See "Do not hot-upgrade
native code that changed" in
[beam-hotupgrades](https://github.com/deployex/beam-hotupgrades).

## Check-Specific Parameters

*There are no specific parameters for this check.*

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
