Quote Originally Posted by jdarling
UPDATE:
Looks like built in profiling is broke http://wiki.freepascal.org/Profiling...ofiler_support except in trunk 251
it says it's broken only for gprof. I'll try with Valgrind.

Thanks form the suggestion.

Quote Originally Posted by User137
How much is "a lot"? I can hardly imagine optimizing this would give any noticable performance increase.
"a lot" is "more than a little"... or something. Actually I don't know how much, but it should in some cases. Any game should draw/blit more than 100 bitmaps/frame so currently it does 200 calls (with parameter passing). Using INLINE it would be reduced to 100 calls. Add calls for input testing (mouse, joystick...) and sound. Yesterday I was rewriting a voxel renderer I wrote some years ago in C. It does test several thousands of voxels each frame, 30 frames per second. That are a lot of calls.

Quote Originally Posted by User137
But i try to avoid wrapping single functions as much as possible. If i can call it directly from unit like OpenGL header i do that.
My fault. I tried to make the API Pascal-like and use Pascal types (i.e. STRING, ARRAY OF SOMETHING) instead of the C ones (pointers, pointers, and more pointers...) whih will force to use typecasting in a lot of calls.