another micro optimization for pypy

This commit is contained in:
Unbit
2013-05-19 06:52:01 +02:00
parent 57e9ccbef0
commit 453d2abed5
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -52,8 +52,7 @@ int uwsgi_pypy_helper_register_rpc(char *name, int argc, void *func) {
return uwsgi_register_rpc(name, &pypy_plugin, argc, func);
}
struct iovec *uwsgi_pypy_helper_environ(int core, uint16_t *len) {
struct wsgi_request *wsgi_req = &uwsgi.workers[uwsgi.mywid].cores[core].req;
struct iovec *uwsgi_pypy_helper_environ(struct wsgi_request *wsgi_req, uint16_t *len) {
*len = wsgi_req->var_cnt;
return wsgi_req->hvec;
}
+2 -2
View File
@@ -30,7 +30,7 @@ int uwsgi_response_add_header(void *, char *, uint16_t, char *, uint16_t);
char *uwsgi_request_body_read(void *, uint64_t, int64_t *);
char *uwsgi_request_body_readline(void *, uint64_t, int64_t *);
struct iovec *uwsgi_pypy_helper_environ(int, uint16_t *);
struct iovec *uwsgi_pypy_helper_environ(void *, uint16_t *);
char *uwsgi_pypy_helper_version();
int uwsgi_pypy_helper_register_signal(int, char *, void *);
@@ -134,7 +134,7 @@ def uwsgi_pypy_wsgi_handler(wsgi_req, core):
environ = {}
nv = ffi.new("uint16_t *")
iov = lib.uwsgi_pypy_helper_environ(core, nv)
iov = lib.uwsgi_pypy_helper_environ(wsgi_req, nv)
for i in range(0, nv[0], 2):
environ[ffi.string(iov[i].iov_base, iov[i].iov_len)] = ffi.string(iov[i+1].iov_base, iov[i+1].iov_len)