test/ring: reduce compilation time
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Wed, 29 Apr 2020 17:57:14 +0000 (18:57 +0100)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 3 Jul 2020 10:05:05 +0000 (12:05 +0200)
commit2d59e9c8e2d87f628a7be9c86b5d25879f175ec6
treea711150ea23b68723a06bde53d49d99617a5a90b
parent5a3f804159bafdaa218daf4c08d1ed2d88781e17
test/ring: reduce compilation time

Rework test code to reduce code complexity for the compiler and
bring down compilation time and memory consumption.
Current test_ring_enqueue/test_ring_dequeue functions contain
too many branches and it takes compiler a lot of effort to resolve all
of them at compile time.
So the patch replaces these branchy function invocations
with an  array of function pointers (test_enqdeq_impl[]).
That way compiler knows straightway which function to use
for each particular case.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
app/test/test_ring.c