[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Sun, Mar 12, 2000 at 05:09:12PM +0000, Shawn Hargreaves wrote:
> You are misunderstanding the whole point of why those constructors exist.
> They are to _improve_ executable size, not make it worse! Without them,
> some modules have to issue calls to other modules, eg. install_sound()
> calls midi_init(), which means that every time you use any sound code, it
> has to link in all the MIDI code as well, even if you never call any MIDI
> functions. The constructors are used to set up an indirect pointer to
> those functions instead, so that the code only gets linked if it is
> actually called. This is a Good Thing, and has no adverse effects at all.
But `_midi_constructor' is in `midi.c' -- surely if it's always
getting called, from `allegro.c', then its code has to be linked
in, so all the code in `midi.c' has to be linked in anyway, even
if you never call `install_sound' even? AFAICS that's certainly
true if constructors aren't available; maybe there's some magic
that makes this argument wrong if they are, though?
I don't see any way that it would be possible to get around this
problem without having separate initialisation functions for
digital sound and MIDI music, and having `install_sound' just
for backward compatibility.
George
--
Random project update:
06/02/2000: AllegroGL alpha 3: use OpenGL with Allegro in Unix or Windows
http://www.canvaslink.com/gfoot/allegrogl/