BGE Python API

Use 'const char *' rather then the C++ 'STR_String' type for the attribute identifier of python attributes.

Each attribute and method access from python was allocating and freeing the string.
A simple test with getting an attribute a loop shows this speeds up attribute lookups a bit over 2x.
This commit is contained in:
Campbell Barton
2009-02-19 13:42:07 +00:00
parent c597863783
commit cdec2b3d15
127 changed files with 392 additions and 403 deletions

View File

@@ -137,7 +137,7 @@ PyMethodDef SCA_NORController::Methods[] = {
{NULL,NULL} //Sentinel
};
PyObject* SCA_NORController::_getattr(const STR_String& attr) {
PyObject* SCA_NORController::_getattr(const char *attr) {
_getattr_up(SCA_IController);
}