Repository navigation
Commit 82476c3
committed
Use on_load module attribute
Before OTP 19.0, if the on_load directive fails, any previously loaded
code would become old, essentially leaving the system without any
working and reachable instance of the module. This is not true anymore
since OTP 19.0, so loading the nifs within the on_load directive is
today the cleanest and best code pattern.
It seems indeed very convoluted to have an entire application and
supervision tree with a worker gen_server just to load the nifs. Also,
one of the `handle_info` heads of the gen_server is even a remnant of
the times when `fast_tls` was implemented as a port driver instead of as
nifs, which is a high sign this needed some modernisation.1 parent 7688cf9 commit 82476c3
4 files changed
Lines changed: 4 additions & 119 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
This file was deleted.
This file was deleted.
0 commit comments