Releases: yuanzhubi/call_in_stack
stable version
Supporting old version of GCC with some particular compile option
We will detect if the old compiler that always enables no-omit-frame-pointer and give an alternative codes to adapt it.
Important adaptive improvement for different version of GCC!
In this version:
We remove __builtin_unreachable in our library because GCC has different semantic in high version;
We disable the -fipa-sra optimize for "do_call" function (with no performance lost because it is an assemble function indeed) in our library because it breaks the system V ABI and arguments forwarding rule.
Support member function and lambda or functor using in call_in_stack
Now we support call_in_stack for member function.
std::string a("Hello world");
call_in_stack(printf, "%s\n", call_in_stack(from_member_fun(a,c_str))) ;
And we support call_in_stack for functor or lambda in C++11!
std::string a("Hello world");
call_in_stack_safe(buf, from_functor(
[=](int arg){
printf("%s\n", a.c_str());
return arg;
}
),2) ;
That means you can write most of your codes of function in a new stack!
Enjoy yourself!
right value reference is supported!
right value reference is supported! Either as an argument type or return value type.
using ENABLE_RIGHT_VALUE_REFERENCE macro in call_in_stack.h or define ENABLE_RIGHT_VALUE_REFERENCE before including call_in_stack.h to open this character.
union the type to reduce the count of template function instance not inlined
//unite the type is to reduce the size of the binary compile result via reducing types,
//including union all the pointer and reference type to word_int_t,
//unsigned and not unsigned integer type to not unsigned.