]> code.delx.au - pulseaudio/commit
object: speed up type verification by not relying on strcmp()
authorLennart Poettering <lennart@poettering.net>
Fri, 21 Aug 2009 19:27:44 +0000 (21:27 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 21 Aug 2009 19:27:44 +0000 (21:27 +0200)
commit9abc010c930999eed67253f5b83f7c226b1a17f6
tree7a60ec4acef9fd7d68dbe97429c6c6d1a5870df8
parent5317e35543ab208a416cc662e2a6a88899a96704
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.
19 files changed:
src/pulsecore/core.c
src/pulsecore/core.h
src/pulsecore/msgobject.c
src/pulsecore/msgobject.h
src/pulsecore/object.c
src/pulsecore/object.h
src/pulsecore/play-memblockq.c
src/pulsecore/protocol-esound.c
src/pulsecore/protocol-native.c
src/pulsecore/protocol-simple.c
src/pulsecore/sink-input.c
src/pulsecore/sink-input.h
src/pulsecore/sink.c
src/pulsecore/sink.h
src/pulsecore/sound-file-stream.c
src/pulsecore/source-output.c
src/pulsecore/source-output.h
src/pulsecore/source.c
src/pulsecore/source.h