When I inspect other people's codes, I sometimes encounter static inline functions implemented in header files as opposed to regular function implementations in C files.

For example, `cache.h` header file (<https://github.com/git/git/blob/master/cache.h>) of `git` contains many such functions. One of them is copied below;

```
static inline void copy_cache_entry(struct cache_entry *dst,
                    const struct cache_entry *src)
{
    unsigned int state = dst->ce_flags & CE_HASHED;

    /* Don't copy hash chain and name */
    memcpy(&dst->ce_stat_data, &src->ce_stat_data,
            offsetof(struct cache_entry, name) -
            offsetof(struct cache_entry, ce_stat_data));

    /* Restore the hash state */
    dst->ce_flags = (dst->ce_flags & ~CE_HASHED) | state;
}

```

I was wondering what are the advantages of using static inline functions compared to regular functions. Is there any guideline one can use to choose which style to adapt?