Memory Management in Embedded Python
Huayang Xia
huayang.xia at gmail.com
Thu Jan 18 13:11:06 EST 2007
More information about the Python-list mailing list
Thu Jan 18 13:11:06 EST 2007
- Previous message (by thread): Memory Management in Embedded Python
- Next message (by thread): Python Web Frameworks
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi there,
I have a piece of code like this:
void funct(PyObject* pyobj)
{
char str[128];
strncpy(str, "just a test string", sizeof(str));
PyObject* pydata = PyObject_CallMethod(pyobj, "method_x",
"s", str);
Py_DECREF(pydata);
}
After the function is exited, the str is not there anymore. Will this
affect python operation. How does python use the str? It's copied or it
just uses the pointer?
Thanks in advance.
- Previous message (by thread): Memory Management in Embedded Python
- Next message (by thread): Python Web Frameworks
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list