PyPy SUPPORT

This commit is contained in:
roberto@mrspurr
2012-03-27 13:58:27 +02:00
parent 196dc45d0b
commit ed8f0812d7
10 changed files with 65 additions and 25 deletions
+12 -6
View File
@@ -6,9 +6,16 @@ struct uwsgi_python up;
extern struct http_status_codes hsc[];
#ifdef UWSGI_PYPY
char *RPython_StartupCode(void);
#define pypy_asm_stack_bottom() asm volatile ("/* GC_STACK_BOTTOM */" : : : \
"memory")
char *RPython_StartupCode(void);
extern struct pypy_pypy_module_cpyext_state_State0 pypy_g_pypy_module_cpyext_state_State;
extern struct pypy_pypy_interpreter_baseobjspace_W_Root0 *pypy_g_call_startup(void);
void pypy_g_State_startup(struct pypy_pypy_module_cpyext_state_State0 *);
void Py_Initialize(void) {
pypy_asm_stack_bottom();
@@ -17,6 +24,9 @@ void Py_Initialize(void) {
uwsgi_log("unable to initialize PyPy: %s\n", errmsg);
exit(1);
}
pypy_g_call_startup();
pypy_g_State_startup(&pypy_g_pypy_module_cpyext_state_State);
}
#endif
@@ -712,11 +722,7 @@ void init_uwsgi_embedded_module() {
#ifdef UNBIT
if (PyDict_SetItemString(up.embedded_dict, "unbit", Py_True)) {
#else
uwsgi_log("UNO\n");
Py_INCREF(Py_None);
uwsgi_log("UNO.0\n");
if (PyDict_SetItemString(up.embedded_dict, "unbit", &_Py_NoneStruct)) {
uwsgi_log("DUE\n");
if (PyDict_SetItemString(up.embedded_dict, "unbit", Py_None)) {
#endif
PyErr_Print();
exit(1);