talvi
2014-07-31 23:33:37 UTC
I apologize if this isn't the right place to ask this, but I couldn't
think of another way,
I'm a Cmus user and I'm studying the source code. I'm a beginner
programmer and there is something I am trying to understand;
I've noticed that starting from version 1.5.0, as noted on the
changelog: 'dynamically loadable plugins'. It seems that the input and
output plugins (for example vorbis.c for input and alsa.c for output)
are compiled into dynamically loadable libraries (.so files), and then
they are loaded using the dlopen function, then put in a doubly-linked
list.
What I want to understand is, why is this technique used, instead of
just turning those sources files to object code and then linking them
into the executable? Is it for performance, or to reduce the memory
usage or something else?
Thanks for your time.
think of another way,
I'm a Cmus user and I'm studying the source code. I'm a beginner
programmer and there is something I am trying to understand;
I've noticed that starting from version 1.5.0, as noted on the
changelog: 'dynamically loadable plugins'. It seems that the input and
output plugins (for example vorbis.c for input and alsa.c for output)
are compiled into dynamically loadable libraries (.so files), and then
they are loaded using the dlopen function, then put in a doubly-linked
list.
What I want to understand is, why is this technique used, instead of
just turning those sources files to object code and then linking them
into the executable? Is it for performance, or to reduce the memory
usage or something else?
Thanks for your time.