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.
This commit is contained in:
Lennart Poettering 2009-08-21 21:27:44 +02:00
parent 5317e35543
commit 9abc010c93
19 changed files with 73 additions and 65 deletions

View file

@ -41,7 +41,7 @@
#define MEMBLOCKQ_MAXLENGTH (32*1024*1024)
static PA_DEFINE_CHECK_TYPE(pa_source_output, pa_msgobject);
PA_DEFINE_PUBLIC_CLASS(pa_source_output, pa_msgobject);
static void source_output_free(pa_object* mo);