Closed mjoras closed 7 years ago
Inline functions less than 10 LOC are considered safe. And in general anything where the implementation is defined by the interface, i.e. couldn't be implemented any other way.
Okay, good to know. Most of the reference counting/atomic functions are very short, so that's probably okay. I do wonder if it would be worth implementing Linux's newer refcount_t
API independently and then defining kref
in terms of that, as is done currently in Linux.
I noticed that there's a non-negligible amount of the Linux KPI that is straight up copied from various versions of Linux (e.g.
kref_put_mutex
), even though the file itself is supposedly licensed as BSD 2-clause.Should we be replacing this code with strictly BSD-licensed code?