Comment

Comment by mbel

Another solution, which seems to be missing is to use function pointers; process_image could receive a pointer to given function instead of n. My experiences with gcc show, that functions passed by pointer are often inlined, which is not really a surprise, since they are constant arguments of the function.

Here is an example [0], although the wrapper functions seem to be redundant in this case.

[0] http://pastebin.com/BAgm61S8

parent mbel 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton