3 ms·
> Function with 9 arguments That's nothing, let me show you some of the ones in the VM... > Mix of abstraction levels What are you referring to here? > Basi
by waddlesplash 7y ago
> Function with 9 arguments
That's nothing, let me show you some of the ones in the VM...
> Mix of abstraction levels
What are you referring to here?
> Basically untestable.
Unit-testable, no. Integration-testable, absolutely; POSIX testsuites are not so hard to write. And this function is called (tens of) thousands of times per hour while you are using the OS, remember.
> Could use RAII.
It is already using RAII reference and lock objects, what improvement do you think could be had here? There are no exceptions in the kernel, so that's not a concern.
If this is your criticism of Haiku's kernel code ... go take a look at some of the equivalents in the BSDs or Linux, then. We are by far and away better than those by your metrics (especially as, you know, those are C and this is C++.)
But do these specific metrics matter? Probably not. "9 arguments" is not a mark against a function in all cases, neither is length or abstraction mixing. Those can and usually are bad, but kernels are a different ballgame altogether.