7 Feb 2011 15:49
Re: function database handling
Chris Allegretta <chrisa <at> asty.org>
2011-02-07 14:49:28 GMT
2011-02-07 14:49:28 GMT
Thank you for this suggestion bernd! Looks like I was able to get this done in less than a year after you made it(Continue reading)Unfortunately this has the effect of increasing our binary size by 10%, at least on x86-64. Having all those shorts instead of stub functions to allow the key remapping may have bene ugly but it did save memory. Still it at least feels better to have the code this way even if this implementation is not perfect. On Sun, May 16, 2010 at 9:39 PM, bernd <bernd.spaeth <at> gmx.net> wrote: > Trying to figure out the design decision for tying up function-database > entries using short integers, preceding something like 150 (!) lines of > preprocessor macro definitions, I stumbled across the following comment. > > /* Since in ISO C you can't pass around function pointers > anymore, > let's make some integer macros for function names, and then > I > can go cut my wrists after writing the big switch > statement > that will necessitate. */ > > As I can only guess, what you were orignially trying to do, I might be > completely wrong with my assumption. > > Nevertheless as far as I know contradictory to conversion of object > pointers to function pointer types, passing function pointers should > still be very much compliant to ISO C. > > Just in case you tried to pass your function pointer like shown in the
Unfortunately this has the effect of increasing our binary size by
10%, at least on x86-64. Having all those shorts instead of stub
functions to allow the key remapping may have bene ugly but it did
save memory. Still it at least feels better to have the code this way
even if this implementation is not perfect.
On Sun, May 16, 2010 at 9:39 PM, bernd <bernd.spaeth <at> gmx.net> wrote:
> Trying to figure out the design decision for tying up function-database
> entries using short integers, preceding something like 150 (!) lines of
> preprocessor macro definitions, I stumbled across the following comment.
>
> /* Since in ISO C you can't pass around function pointers
> anymore,
> let's make some integer macros for function names, and then
> I
> can go cut my wrists after writing the big switch
> statement
> that will necessitate. */
>
> As I can only guess, what you were orignially trying to do, I might be
> completely wrong with my assumption.
>
> Nevertheless as far as I know contradictory to conversion of object
> pointers to function pointer types, passing function pointers should
> still be very much compliant to ISO C.
>
> Just in case you tried to pass your function pointer like shown in the
RSS Feed