mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 13:41:28 +00:00
more fixes for OSX
This commit is contained in:
+4
-1
@@ -2,6 +2,9 @@ import uwsgi
|
||||
|
||||
def application(env, start_response):
|
||||
start_response('200 OK', [('Content-Type', 'text/plain')])
|
||||
yield "Shared counter is %d\n" % uwsgi.sharedarea_inclong(100)
|
||||
try:
|
||||
yield "Shared counter is %d\n" % uwsgi.sharedarea_inclong(100)
|
||||
except:
|
||||
yield 'Hello World'
|
||||
|
||||
applications = {'/':'application'}
|
||||
|
||||
@@ -1710,13 +1710,13 @@ void log_request() {
|
||||
get_memusage();
|
||||
#ifndef UNBIT
|
||||
#ifdef __APPLE__
|
||||
fprintf(stderr,"{address space usage: %ld bytes/%luMB} {rss usage: %lu bytes/%luMB} ", wsgi_req.vsz_size, wsgi_req.vsz_size/1024/1024, wsgi_req.rss_size, wsgi_req.rss_size/1024/1024) ;
|
||||
fprintf(stderr,"{address space usage: %lld bytes/%lluMB} {rss usage: %llu bytes/%lluMB} ", wsgi_req.vsz_size*4096, (wsgi_req.vsz_size*PAGE_SIZE)/1024/1024, wsgi_req.rss_size*PAGE_SIZE, (wsgi_req.rss_size*PAGE_SIZE)/1024/1024) ;
|
||||
#endif
|
||||
#ifdef LINIX
|
||||
fprintf(stderr,"{address space usage: %ld bytes/%luMB} {rss usage: %lu bytes/%luMB} ", wsgi_req.vsz_size, wsgi_req.vsz_size/1024/1024, wsgi_req.rss_size*PAGE_SIZE, (wsgi_req.rss_size*PAGE_SIZE)/1024/1024) ;
|
||||
#ifdef LINUX
|
||||
fprintf(stderr,"{address space usage: %lld bytes/%lluMB} {rss usage: %llu bytes/%luMB} ", wsgi_req.vsz_size, wsgi_req.vsz_size/1024/1024, wsgi_req.rss_size*PAGE_SIZE, (wsgi_req.rss_size*PAGE_SIZE)/1024/1024) ;
|
||||
#endif
|
||||
#else
|
||||
fprintf(stderr,"{address space usage: %ld bytes/%luMB} ", wsgi_req.vsz_size, wsgi_req.vsz_size/1024/1024) ;
|
||||
fprintf(stderr,"{address space usage: %lld bytes/%lluMB} ", wsgi_req.vsz_size, wsgi_req.vsz_size/1024/1024) ;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@@ -1758,7 +1758,6 @@ void get_memusage() {
|
||||
wsgi_req.vsz_size = syscall(356);
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
task_t task = MACH_PORT_NULL;
|
||||
struct task_basic_info t_info;
|
||||
mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT;
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#ifdef __APPLE__
|
||||
#include <libkern/OSAtomic.h>
|
||||
#include <mach/task.h>
|
||||
#include <mach/mach_init.h>
|
||||
#endif
|
||||
|
||||
#ifdef UNBIT
|
||||
@@ -58,7 +59,9 @@
|
||||
#define NL_SIZE 2
|
||||
#define H_SEP_SIZE 2
|
||||
|
||||
#ifndef PAGE_SIZE
|
||||
#define PAGE_SIZE 4096
|
||||
#endif
|
||||
|
||||
#define UWSGI_RELOAD_CODE 17
|
||||
#define UWSGI_END_CODE 30
|
||||
@@ -105,8 +108,8 @@ struct __attribute__((packed)) wsgi_request {
|
||||
int response_size;
|
||||
int headers_size;
|
||||
// memory debug
|
||||
unsigned long vsz_size;
|
||||
long rss_size;
|
||||
unsigned long long vsz_size;
|
||||
long long rss_size;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user