Commit a966927c authored by Roman Yurchak's avatar Roman Yurchak Committed by GitHub

Merge pull request #197 from mdboom/faster-way-to-handle-bound-method-name

No need to copy bound method name
parents 94e935b4 5b84311d
......@@ -416,12 +416,10 @@ JsProxy_cnew(int idobj)
//
// A special class for bound methods
const size_t BOUND_METHOD_NAME_SIZE = 256;
typedef struct
{
PyObject_HEAD int this_;
char name[BOUND_METHOD_NAME_SIZE];
const char* name;
} JsBoundMethod;
static void
......@@ -469,7 +467,7 @@ JsBoundMethod_cnew(int this_, const char* name)
JsBoundMethod* self;
self = (JsBoundMethod*)JsBoundMethodType.tp_alloc(&JsBoundMethodType, 0);
self->this_ = hiwire_incref(this_);
strncpy(self->name, name, BOUND_METHOD_NAME_SIZE);
self->name = name;
return (PyObject*)self;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment