From 9abc010c930999eed67253f5b83f7c226b1a17f6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 21 Aug 2009 21:27:44 +0200 Subject: object: speed up type verification by not relying on strcmp() Instead of using string contents for type identification use the address of a constant string array. This should speed up type verifications a little sind we only need to compare one machine word instead of a full string. Also, this saves a few strings. To make clear that types must be compared via address and not string contents 'type_name' is now called 'type_id'. This also simplifies the macros for declaring and defining public and private subclasses. --- src/pulsecore/play-memblockq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/pulsecore/play-memblockq.c') diff --git a/src/pulsecore/play-memblockq.c b/src/pulsecore/play-memblockq.c index fceb2ca1..b0d76993 100644 --- a/src/pulsecore/play-memblockq.c +++ b/src/pulsecore/play-memblockq.c @@ -47,9 +47,8 @@ enum { MEMBLOCKQ_STREAM_MESSAGE_UNLINK, }; -PA_DECLARE_CLASS(memblockq_stream); +PA_DEFINE_PRIVATE_CLASS(memblockq_stream, pa_msgobject); #define MEMBLOCKQ_STREAM(o) (memblockq_stream_cast(o)) -static PA_DEFINE_CHECK_TYPE(memblockq_stream, pa_msgobject); static void memblockq_stream_unlink(memblockq_stream *u) { pa_assert(u); -- cgit