Remove implementation-specific inline functions with exactly one caller?
Sebastian Huber
sebastian.huber at embedded-brains.de
Tue Oct 13 11:40:55 UTC 2020
Hello,
we have a couple of implementation-specific inline functions defined in
header files which have exactly one caller. I think we should remove
these functions in general, to reduce the lines of code, making code
review easier, and reduce the number of functions which need
documentation. If it makes the caller site more clear, then we should
place them in the source file of the caller. Examples:
cpukit/rtems/src/partcreate.c: the_partition = _Partition_Allocate();
cpukit/include/rtems/rtems/partimpl.h:RTEMS_INLINE_ROUTINE
Partition_Control *_Partition_Allocate ( void )
cpukit/include/rtems/rtems/regionimpl.h:RTEMS_INLINE_ROUTINE bool
_Region_Free_segment (
cpukit/rtems/src/regionreturnsegment.c: if ( _Region_Free_segment(
the_region, segment ) ) {
cpukit/sapi/src/extensiondelete.c: the_extension = _Extension_Get( id );
cpukit/include/rtems/extensionimpl.h:RTEMS_INLINE_ROUTINE
Extension_Control *_Extension_Get( Objects_Id id )
cpukit/sapi/src/extensioncreate.c: the_extension = _Extension_Allocate();
cpukit/include/rtems/extensionimpl.h:RTEMS_INLINE_ROUTINE
Extension_Control *_Extension_Allocate( void )
cpukit/sapi/src/extensiondelete.c: _Extension_Free( the_extension );
cpukit/include/rtems/extensionimpl.h:RTEMS_INLINE_ROUTINE void
_Extension_Free (
What do you think?
More information about the devel
mailing list