When we want to change income parametr in C++ function we just declare this - void SomeFunc(type& parametr). This are never was a trouble - never. But in managed languges we must add in or out keyword and that leads to unessesery work and sometimes to stupid mistakes. It is to sad that Angel Script force us to this annoing thing. It is possible to disable this behaveor - we don't want managed style we want c++ style
- Viewing Profile: Topics: _Engine_
Community Stats
- Group Members
- Active Posts 41
- Profile Views 921
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
User Tools
Contacts
_Engine_ hasn't added any contacts yet.
Topics I've Started
in and out keywords in parameters
28 January 2013 - 08:40 AM
When we want to change income parametr in C++ function we just declare this - void SomeFunc(type& parametr). This are never was a trouble - never. But in managed languges we must add in or out keyword and that leads to unessesery work and sometimes to stupid mistakes. It is to sad that Angel Script force us to this annoing thing. It is possible to disable this behaveor - we don't want managed style we want c++ style
perfomances issues with classes in array
21 January 2013 - 02:22 AM
Hi!
In script we store data in angel script classes. Also we have array of classes.
Sample look like:
class StoreData
{
int data1, data2;
float data1, data2;
}
array<StoreData> data;
But big problem lie in fact that in memory 100 elements of array is just pointers. Actual data lies randomly in memory, so if we try to access to field data1 of 100 elements in loop we catch many many cache misses. Also we cannot binary save this array we must access to every field of every element in array.
So classes in array is big bottleneck.
Is it possible to avoid this issue?
crash on asCContext::CleanStackFrame()
10 December 2012 - 02:51 PM
We encountered with crash in
as_context.cpp, line: 4159
// Only destroy the object if it is truly alive
if( liveObjects[n] > 0 )
{
asSTypeBehaviour *beh = &amp;m_currentFunction->objVariableTypes[n]->beh;
if( beh->destruct )
m_engine->CallObjectMethod((void*)(asPWORD*)&amp;m_regs.stackFramePointer[-pos], beh->destruct); // crash here
}
looks like problem occurs when using script function like
string FormatInt(int val)
{
if (val < 10) return "0" + val;
return "" + val;
}
void SomeFunc()
{
...
Log(FormatInt(a) + ":" + FormatInt(b) + ":" + FormatInt(d));
...
}
so problem definitely in returning string in function as result. That's lead to illegal stack and crash.
And worse of all of this - crash occures on IOS and on Android and not on PC. SO we can't provide sample to you.
registering virtual properties
16 November 2012 - 07:02 AM
I can declare global class throught binding with c++ code. Can i bind virtual properties? I don't find any clue in documentation about this feature (((
char* or const char* in binding functions to script
30 October 2012 - 01:59 AM
In script we can use only string but they are very very slow because using of strings leads to lots of allocations.
Simple example:
strint str;
str = "lots" + " of " + "allocations";
this simple line of code leads to 7 allocations and 3 deallocations. If we put 10 such line of code and we got 70 allocations and 30 deallocations in single frame. And this is awefull because this becaume bottlenck.
This problem may gone if i would bind functions like void opAdd(const char* in) / void opAdd(char* in) but i can't do that (((
Also in c++ code we never use std::string, we use only char str[] and we never have problems with unnecessary allocations. Also, because
we can't bind function with char* as parameter almost always we got unnecessary allocation when we call c++ function from script containing string as parametr.
Is there are any solution to avoid problem with string allocations? Do not use strings not a option (((
- Home
- » Viewing Profile: Topics: _Engine_

Find content