• Kent Overstreet's avatar
    six locks: Simplify dispatch · c4bd3491
    Kent Overstreet authored
    Originally, we used inlining/flattening to cause the compiler to
    generate different versions of lock/trylock/relock/unlock for each lock
    type - read, intent, and write. This made the individual functions
    smaller and let the compiler eliminate table lookups: however, as the
    code has gotten more complicated these optimizations have gotten less
    worthwhile, and all the tricky inlining and dispatching made the code
    less readable.
    
    Text size: 11015 bytes -> 7467 bytes, and benchmarks show no loss of
    performance.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    c4bd3491
six.c 19.1 KB