Now that the we have fixed the last known bug of Allegro ( ) I wonder if I can optimize it before next release.

First I've read that INLINE keyword only has effect in the unit it's used. That means I can't use it to avoid the extra-call at all. I that true? Most functions and procedures are just wrappers around the actual call. For example, the sprite drawing procedure:
Code:
PROCEDURE al_draw_sprite_ex (bmp, sprite: AL_BITMAPptr; x, y, mode, flip: LONGINT);
BEGIN
 bmp^.vtable^.draw_sprite_ex (bmp, sprite, x, y, mode, flip);
END;
Another group of procedures uses wrappers to make it more Pascal-like and/or use Pascal data types:
Code:
(* Function for messages. *)
 PROCEDURE _allegro_message (CONST msg: PCHAR); CDECL;
  EXTERNAL ALLEGRO_SHARED_LIBRARY_NAME NAME 'allegro_message';

(* Outputs a message. *)
 PROCEDURE al_message (CONST msg: STRING);
 BEGIN
  _allegro_message (PCHAR (msg));
 END;
I think that just "inlining" that calls (and there are a lot of them) performance should rise up a lot because almost all sprite and polygon drawing are like the previous ones. Actually they're implemented as macros in C (you know, " #define ...").

Other question. How can I profile FPC programs? I did use gprof some years ago but I don't remember how does it work. Can I use it with FPC?