mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
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:
parent
5317e35543
commit
9abc010c93
19 changed files with 73 additions and 65 deletions
|
|
@ -64,9 +64,8 @@ enum {
|
|||
FILE_STREAM_MESSAGE_UNLINK
|
||||
};
|
||||
|
||||
PA_DECLARE_CLASS(file_stream);
|
||||
PA_DEFINE_PRIVATE_CLASS(file_stream, pa_msgobject);
|
||||
#define FILE_STREAM(o) (file_stream_cast(o))
|
||||
static PA_DEFINE_CHECK_TYPE(file_stream, pa_msgobject);
|
||||
|
||||
/* Called from main context */
|
||||
static void file_stream_unlink(file_stream *u) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue