Closed erlanger closed 9 years ago
We can make it even easier by not requiring bootsrap && configure for marshalling. I just tried it with my patch applied and the only error I get is that the compiler can't find eixx/config.h ; I placed an empty include/eixx/config.h and everything compiled and worked fine without bootstrap, configure && make. I haven't looked at the side-effects of the empty config.h (like missing the EIXX version number , etc) so I will leave it for later.
oops, in the speed comparison I meant seconds not micro-seconds. Sorry....
Header-only marshalling
This is a simple patch, all the tests pass without errors. I moved the link-time objects that were required for marshalling into the headers.
This will allow people to use the marshalling functionality without linking to libeixx.so, only using the eterm.hpp header with one of the alloc headers. e.g.
compile with
(notice no need for -leixx)
For some objects I simply made an inline static function to return the object (to prevent multiple definitions of the same object).
Unintended side-effect: Speed
It had the nice side effect of making it a little faster, from 6.28us total time to 5.86us. I presume it is because of the inlining of functions. With the patch:
Without the patch:
Hope you find it useful and also your users.