Would it be better to define the below functions as macro or inline functions? Or is it better to use normal functions and trust the compiler, to maintain (in my opinion) better readability?
typedef unsigned char byte;
void set_size_mark(byte size_mark, byte *ptr)
{
*ptr += size_mark << 1;
}
byte get_size_mark(byte *ptr)
{
return *ptr >> 1;
}
You probably should declare these as
static inlinefunctions and define them in a header file.(Alternatively, enable link-time optimization by compiling and linking with
gcc -flto -O2, using a recent GCC)