diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-13 14:24:34 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-13 14:24:34 -0800 |
commit | 67fc4da87820c1f1eb6e2de4a4fdf0182deaff1c (patch) | |
tree | 262edc5bb8a291ade41d23d9948cf16143d0b369 | |
parent | 3b2fa85a952bbbe76c059697acda4253b60beaf3 (diff) | |
parent | 786feded8fb68c9bb024ce9adb510c3e1b1bc0f0 (diff) |
Merge pull request #2125 from waywardmonkeys/upstream-from-imvu
mark several embind functions as always_inline: this reduces code size
-rw-r--r-- | system/include/emscripten/bind.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h index 4d7547a1..390533f3 100644 --- a/system/include/emscripten/bind.h +++ b/system/include/emscripten/bind.h @@ -17,6 +17,8 @@ namespace emscripten { BY_EMVAL = 2, }; +#define EMSCRIPTEN_ALWAYS_INLINE __attribute__((always_inline)) + namespace internal { typedef long GenericEnumValue; @@ -958,7 +960,7 @@ namespace emscripten { } template<typename ReturnType, typename... Args, typename... Policies> - const class_& function(const char* methodName, ReturnType (ClassType::*memberFunction)(Args...), Policies...) const { + EMSCRIPTEN_ALWAYS_INLINE const class_& function(const char* methodName, ReturnType (ClassType::*memberFunction)(Args...), Policies...) const { using namespace internal; typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, AllowedRawPointer<ClassType>, Args...> args; @@ -973,7 +975,7 @@ namespace emscripten { } template<typename ReturnType, typename... Args, typename... Policies> - const class_& function(const char* methodName, ReturnType (ClassType::*memberFunction)(Args...) const, Policies...) const { + EMSCRIPTEN_ALWAYS_INLINE const class_& function(const char* methodName, ReturnType (ClassType::*memberFunction)(Args...) const, Policies...) const { using namespace internal; typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, AllowedRawPointer<const ClassType>, Args...> args; @@ -988,7 +990,7 @@ namespace emscripten { } template<typename ReturnType, typename ThisType, typename... Args, typename... Policies> - const class_& function(const char* methodName, ReturnType (*function)(ThisType, Args...), Policies...) const { + EMSCRIPTEN_ALWAYS_INLINE const class_& function(const char* methodName, ReturnType (*function)(ThisType, Args...), Policies...) const { using namespace internal; typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, ThisType, Args...> args; @@ -1003,7 +1005,7 @@ namespace emscripten { } template<typename FieldType, typename = typename std::enable_if<!std::is_function<FieldType>::value>::type> - const class_& property(const char* fieldName, const FieldType ClassType::*field) const { + EMSCRIPTEN_ALWAYS_INLINE const class_& property(const char* fieldName, const FieldType ClassType::*field) const { using namespace internal; _embind_register_class_property( @@ -1019,7 +1021,7 @@ namespace emscripten { } template<typename FieldType, typename = typename std::enable_if<!std::is_function<FieldType>::value>::type> - const class_& property(const char* fieldName, FieldType ClassType::*field) const { + EMSCRIPTEN_ALWAYS_INLINE const class_& property(const char* fieldName, FieldType ClassType::*field) const { using namespace internal; _embind_register_class_property( @@ -1035,7 +1037,7 @@ namespace emscripten { } template<typename Getter> - const class_& property(const char* fieldName, Getter getter) const { + EMSCRIPTEN_ALWAYS_INLINE const class_& property(const char* fieldName, Getter getter) const { using namespace internal; typedef GetterPolicy<Getter> GP; _embind_register_class_property( @@ -1051,7 +1053,7 @@ namespace emscripten { } template<typename Getter, typename Setter> - const class_& property(const char* fieldName, Getter getter, Setter setter) const { + EMSCRIPTEN_ALWAYS_INLINE const class_& property(const char* fieldName, Getter getter, Setter setter) const { using namespace internal; typedef GetterPolicy<Getter> GP; typedef SetterPolicy<Setter> SP; @@ -1068,7 +1070,7 @@ namespace emscripten { } template<typename ReturnType, typename... Args, typename... Policies> - const class_& class_function(const char* methodName, ReturnType (*classMethod)(Args...), Policies...) const { + EMSCRIPTEN_ALWAYS_INLINE const class_& class_function(const char* methodName, ReturnType (*classMethod)(Args...), Policies...) const { using namespace internal; typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, Args...> args; |