Comments (13)
Iām sorry. Can you define KAGUYA_RETURN_VALUE_OPTIMIZATION 0 or change in kaguya/config.hpp ?
If faster change. i remove it.
from kaguya.
#define KAGUYA_RETURN_VALUE_OPTIMIZATION 0 will faster than 1.
but the function call remain slow than property call.
from kaguya.
OK. When I get home,will check it.
from kaguya.
Bug. This function not push v to Lua.
namespace nativefunction
{
#if KAGUYA_RETURN_VALUE_OPTIMIZATION
template<typename T>
struct is_return_reference_optimize :traits::integral_constant<bool,
is_usertype<typename traits::decay<T>::type>::value &&
(traits::is_pointer<T>::value ||
traits::is_lvalue_reference<T>::value)>{};
template<typename T>
inline int optimized_push_return_value(lua_State* state,T* v)
{
int top = lua_gettop(state);
for (int i = 1; i <= top; ++i)
{
if (lua_type_traits<T*>::get(state, i))
{
lua_pushvalue(state, i);
return 1;
}
}
return util::push_args(state, v);
};
from kaguya.
Not bug (but very slow). If argument and return value(v) is same, push stack valuelua_pushvalue(state, i);
, It is no newuserdata(not heap allocation).
from kaguya.
I known what your mean. but only check argument type not argument value. eg.
Node* Node::CreateChild(const char* name);
will not push the return value to stack.
from kaguya.
Omg! you are right. Thanks!
from kaguya.
Forgot ==v
, but already remove that.
from kaguya.
Thanks. By the way, Where are you?
from kaguya.
at home now.
from kaguya.
No. it's seacret.
from kaguya.
Sorry. Kaguya is cool. If you have time, I want to invite you work on Urho3D.
from kaguya.
Thanks.
from kaguya.
Related Issues (20)
- Kaguya does not work properly with dynamic libraries
- Generate kaguya.hpp and check your error! HOT 2
- Copy constructor
- Result of checkErrorAndThrow is ignored
- Possible to add overloaded constructors at runtime?
- How to register class static member function with default arguments? HOT 1
- An object is not automatically casted into a function parameter HOT 1
- error: type mismatch in diferent dynamic lib HOT 1
- Can't bind functor returned by std::bind HOT 1
- About class inheritance
- std::function and self HOT 3
- Check range of integral when converting from number
- how can I check function has timeout HOT 1
- Reject extra arguments to .new(), etc.
- Returning reference to class needs a copy constructor?
- can not assign a table from lua to a class member attribute
- Returning nil in multiple returns HOT 2
- get Current File/Line of Lua Code HOT 3
- How do I use a variable number of parameters HOT 2
- kaguya call lua HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kaguya.